diff options
author | Dave Parks <davep@lindenlab.com> | 2011-05-30 01:25:55 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-05-30 01:25:55 -0500 |
commit | eca17c8993aecfd8d69c1b1765f8ac841ad29119 (patch) | |
tree | f876d76ad19db1fa18c56f7c61efd4b10648c747 /indra/llrender | |
parent | 57725bd6a14f471cae1a0f4ac7485ab9ccd8bfc6 (diff) |
SH-1682 Full integration if indexed texture rendering to improve batch size.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llglslshader.h | 1 | ||||
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 72 |
3 files changed, 66 insertions, 9 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 2e7147a3b4..71d24bcf13 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -56,7 +56,7 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) LLShaderFeatures::LLShaderFeatures() : calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false), hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false), -hasGamma(false), hasLighting(false), calculatesAtmospherics(false) +hasGamma(false), hasLighting(false), calculatesAtmospherics(false), disableTextureIndex(false) { } diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index d46ddbbe18..392688bba3 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -45,6 +45,7 @@ public: bool hasObjectSkinning; bool hasAtmospherics; bool hasGamma; + bool disableTextureIndex; // char numLights; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index b8f9c60ca9..6fb1e6e437 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -209,7 +209,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) if (features->hasWaterFog) { - if (!shader->attachObject("lighting/lightWaterF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightWaterNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightWaterF.glsl")) { return FALSE; } @@ -217,7 +224,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) else { - if (!shader->attachObject("lighting/lightF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightF.glsl")) { return FALSE; } @@ -230,14 +244,28 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) if (features->isShiny && features->hasWaterFog) { - if (!shader->attachObject("lighting/lightFullbrightShinyWaterF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightFullbrightShinyWaterNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightFullbrightShinyWaterF.glsl")) { return FALSE; } } else if (features->hasWaterFog) { - if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl")) { return FALSE; } @@ -245,7 +273,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) else if (features->isShiny) { - if (!shader->attachObject("lighting/lightFullbrightShinyF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightFullbrightShinyNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightFullbrightShinyF.glsl")) { return FALSE; } @@ -253,7 +288,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) else { - if (!shader->attachObject("lighting/lightFullbrightF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightFullbrightNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightFullbrightF.glsl")) { return FALSE; } @@ -266,7 +308,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) if (features->hasWaterFog) { - if (!shader->attachObject("lighting/lightShinyWaterF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightShinyWaterNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightShinyWaterF.glsl")) { return FALSE; } @@ -274,7 +323,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) else { - if (!shader->attachObject("lighting/lightShinyF.glsl")) + if (features->disableTextureIndex) + { + if (!shader->attachObject("lighting/lightShinyNonIndexedF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightShinyF.glsl")) { return FALSE; } |