summaryrefslogtreecommitdiff
path: root/indra/llrender/llshadermgr.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-06-23 23:06:36 -0500
committerDave Parks <davep@lindenlab.com>2011-06-23 23:06:36 -0500
commit253642ccff9b08da5e62449ff62b23e986dcb77d (patch)
tree1118351f770d4b07c720527bf02c74e1bfd26c29 /indra/llrender/llshadermgr.cpp
parent56f8396ff15b7d827f008edd6fe263bae26313f0 (diff)
SH-1903 Don't use indexed texture rendering when GL version is < 3.1 (fixes bad performance on cards with old drivers)
Diffstat (limited to 'indra/llrender/llshadermgr.cpp')
-rw-r--r--indra/llrender/llshadermgr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index bdc103b917..3910cd779c 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -524,7 +524,12 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
text[count++] = strdup("{\n");
- if (gGLManager.mGLVersion >= 3.f)
+ if (texture_index_channels == 1)
+ { //don't use flow control, that's silly
+ text[count++] = strdup("return texture2D(tex0, texcoord);\n");
+ text[count++] = strdup("}\n");
+ }
+ else if (gGLManager.mGLVersion >= 3.f)
{
text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n");
text[count++] = strdup("\t{\n");