diff options
author | Graham Madarasz (Graham) <graham@lindenlab.com> | 2013-02-28 09:33:41 -0800 |
---|---|---|
committer | Graham Madarasz (Graham) <graham@lindenlab.com> | 2013-02-28 09:33:41 -0800 |
commit | df08808640031bd27a11177ea49a08f797d2d570 (patch) | |
tree | 7a9839786ec0a09ccdb8421ced92b14a5ad62d8e /indra/newview/llwlparammanager.cpp | |
parent | 2c9636a9e5cb016d05741f214ac117dcae1ea317 (diff) |
Improve perf of GLSL uniform lookups by name
Diffstat (limited to 'indra/newview/llwlparammanager.cpp')
-rw-r--r-- | indra/newview/llwlparammanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 6077208799..65cb80c3e7 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -61,6 +61,9 @@ #include "curl/curl.h" #include "llstreamtools.h" +static LLStaticHashedString sCamPosLocal("camPosLocal"); +static LLStaticHashedString sSceneLightStrength("scene_light_strength"); + LLWLParamManager::LLWLParamManager() : //set the defaults for the controls @@ -352,7 +355,7 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader) if (shader->mShaderGroup == LLGLSLShader::SG_DEFAULT) { shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV); - shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); + shader->uniform3fv(sCamPosLocal, 1, LLViewerCamera::getInstance()->getOrigin().mV); } else if (shader->mShaderGroup == LLGLSLShader::SG_SKY) @@ -360,7 +363,7 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader) shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mClampedLightDir.mV); } - shader->uniform1f("scene_light_strength", mSceneLightStrength); + shader->uniform1f(sSceneLightStrength, mSceneLightStrength); } |