summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolbump.cpp
diff options
context:
space:
mode:
authorGraham Madarasz (Graham) <graham@lindenlab.com>2013-02-28 09:33:41 -0800
committerGraham Madarasz (Graham) <graham@lindenlab.com>2013-02-28 09:33:41 -0800
commitdf08808640031bd27a11177ea49a08f797d2d570 (patch)
tree7a9839786ec0a09ccdb8421ced92b14a5ad62d8e /indra/newview/lldrawpoolbump.cpp
parent2c9636a9e5cb016d05741f214ac117dcae1ea317 (diff)
Improve perf of GLSL uniform lookups by name
Diffstat (limited to 'indra/newview/lldrawpoolbump.cpp')
-rw-r--r--indra/newview/lldrawpoolbump.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 8d1db7b9ad..4137084ebe 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1368,9 +1368,14 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
LLGLDisable blend(GL_BLEND);
gGL.setColorMask(TRUE, TRUE);
gNormalMapGenProgram.bind();
- gNormalMapGenProgram.uniform1f("norm_scale", gSavedSettings.getF32("RenderNormalMapScale"));
- gNormalMapGenProgram.uniform1f("stepX", 1.f/bump->getWidth());
- gNormalMapGenProgram.uniform1f("stepY", 1.f/bump->getHeight());
+
+ static LLStaticHashedString sNormScale("norm_scale");
+ static LLStaticHashedString sStepX("stepX");
+ static LLStaticHashedString sStepY("stepY");
+
+ gNormalMapGenProgram.uniform1f(sNormScale, gSavedSettings.getF32("RenderNormalMapScale"));
+ gNormalMapGenProgram.uniform1f(sStepX, 1.f/bump->getWidth());
+ gNormalMapGenProgram.uniform1f(sStepY, 1.f/bump->getHeight());
LLVector2 v((F32) bump->getWidth()/gPipeline.mScreen.getWidth(),
(F32) bump->getHeight()/gPipeline.mScreen.getHeight());