Use LLStaticHashedString for faster uniform lookup.

This commit is contained in:
Shyotl
2013-10-26 16:26:46 -05:00
parent 8e94c43a54
commit 8441bc80a4
20 changed files with 579 additions and 322 deletions

View File

@@ -1370,9 +1370,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(sStepX, 1.f/bump->getHeight());
LLVector2 v((F32) bump->getWidth()/gPipeline.mScreen.getWidth(),
(F32) bump->getHeight()/gPipeline.mScreen.getHeight());