diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2024-01-23 15:17:15 -0800 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2024-01-25 10:32:37 -0800 |
commit | 97764080b0eaf7b359b7e2332e6c1257ba86a71a (patch) | |
tree | 333357f1056bd8fca48ddc194deec818cad82c27 /indra/newview/llgltfmaterialpreviewmgr.cpp | |
parent | 85bf567010d54b64b3144397bff7c3c0448d85da (diff) |
Review feedback: Remove static RenderLocalLightCount, as cached settings refresh has surprising performance cost
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index a8ea3429f4..1dba3f082f 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -34,6 +34,7 @@ #include "llenvironment.h" #include "llselectmgr.h" #include "llviewercamera.h" +#include "llviewercontrol.h" #include "llviewerobject.h" #include "llviewershadermgr.h" #include "llviewertexturelist.h" @@ -419,7 +420,8 @@ BOOL LLGLTFPreviewTexture::render() LLVector3 light_dir3(1.0f, 1.0f, 1.0f); light_dir3.normalize(); const LLVector4 light_dir = LLVector4(light_dir3, 0); - SetTemporarily<S32> sun_light_only(&LLPipeline::RenderLocalLightCount, 0); + const S32 old_local_light_count = gSavedSettings.get<S32>("RenderLocalLightCount"); + gSavedSettings.set<S32>("RenderLocalLightCount", 0); gPipeline.mReflectionMapManager.forceDefaultProbeAndUpdateUniforms(); @@ -524,6 +526,7 @@ BOOL LLGLTFPreviewTexture::render() // Clean up gPipeline.setupHWLights(); gPipeline.mReflectionMapManager.forceDefaultProbeAndUpdateUniforms(false); + gSavedSettings.set<S32>("RenderLocalLightCount", old_local_light_count); return TRUE; } |