Client: Add shader precache fix for dlights/rtlights, this should eliminate the first shot of any game causing any stuttering

This commit is contained in:
Marco Cawthorne 2023-02-24 12:24:24 -08:00
parent f0dcdc28c5
commit a36694d1f8
Signed by: eukara
GPG key ID: CE2032F0A2882A22
2 changed files with 7 additions and 0 deletions

View file

@ -96,6 +96,8 @@
#define PRINT_HIGH 2
#define PRINT_CHAT 3
var bool g_dlight_cached = false;
const float MASK_GLOWS = 16;
var bool g_focus;
bool Util_IsFocused(void);

View file

@ -291,6 +291,11 @@ CSQC_UpdateView(float w, float h, float focus)
else
g_view.SetViewMode(VIEWMODE_FPS);
if (g_dlight_cached == false) {
g_dlight_cached = true;
dynamiclight_add(g_view.GetCameraOrigin(), 16, [0.1,0.1,0.1]);
}
g_view.UpdateView();
/* 2D calls happen here, after rendering is done */