From e1c7688b2c69c3a79b673011abe6d59ce97acdff Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 26 Nov 2018 18:50:40 +0200 Subject: SL-10101 Remade most frequent setting calls to cached variants --- indra/newview/llviewershadermgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ff7647a7e4..f610335b07 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -399,7 +399,8 @@ void LLViewerShaderMgr::setShaders() return; } - LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1); + static LLCachedControl max_texture_index(gSavedSettings, "RenderMaxTextureIndex", 16); + LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) max_texture_index), 1); //NEVER use more than 16 texture channels (work around for prevalent driver bug) LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16); -- cgit v1.2.3