summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolterrain.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/lldrawpoolterrain.cpp
parent2c9636a9e5cb016d05741f214ac117dcae1ea317 (diff)
Improve perf of GLSL uniform lookups by name
Diffstat (limited to 'indra/newview/lldrawpoolterrain.cpp')
-rw-r--r--indra/newview/lldrawpoolterrain.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 9bc32fddbd..3805348b6b 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -49,6 +49,9 @@
#include "llviewershadermgr.h"
#include "llrender.h"
+static LLStaticHashedString sObjectPlaneS("object_plane_s");
+static LLStaticHashedString sObjectPlaneT("object_plane_t");
+
const F32 DETAIL_SCALE = 1.f/16.f;
int DebugDetailMap = 0;
@@ -352,8 +355,8 @@ void LLDrawPoolTerrain::renderFullShader()
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
llassert(shader);
- shader->uniform4fv("object_plane_s", 1, tp0.mV);
- shader->uniform4fv("object_plane_t", 1, tp1.mV);
+ shader->uniform4fv(sObjectPlaneS, 1, tp0.mV);
+ shader->uniform4fv(sObjectPlaneT, 1, tp1.mV);
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
@@ -862,8 +865,8 @@ void LLDrawPoolTerrain::renderSimple()
if (LLGLSLShader::sNoFixedFunction)
{
- sShader->uniform4fv("object_plane_s", 1, tp0.mV);
- sShader->uniform4fv("object_plane_t", 1, tp1.mV);
+ sShader->uniform4fv(sObjectPlaneS, 1, tp0.mV);
+ sShader->uniform4fv(sObjectPlaneT, 1, tp1.mV);
}
else
{