summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-10-19 13:21:17 -0500
committerDave Parks <davep@lindenlab.com>2011-10-19 13:21:17 -0500
commitfe51889b2914a9f117d5f19d91072716b5913579 (patch)
tree35317e27314daec19ab20bd9d40702210a390472
parent506a91beb83bc1fb9a5ee77ee83544b6293e534a (diff)
SH-2276 Force RenderMaxTextureIndex to be <= 16 regardless of settings
-rw-r--r--indra/newview/llviewershadermgr.cpp3
-rwxr-xr-xindra/newview/llvovolume.cpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 31ed210ae3..50910e26e5 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -357,6 +357,9 @@ void LLViewerShaderMgr::setShaders()
LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);
+ //NEVER use more than 16 texture channels (work around for prevalent driver bug)
+ LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16);
+
reentrance = true;
if (LLRender::sGLCoreProfile || gGLManager.mGLVersion >= 2.f)
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2fadc795fd..b75a0a799a 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4666,6 +4666,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
texture_index_channels = llmin(texture_index_channels, (S32) gSavedSettings.getU32("RenderMaxTextureIndex"));
+ //NEVER use more than 16 texture index channels (workaround for prevalent driver bug)
+ texture_index_channels = llmin(texture_index_channels, 16);
while (face_iter != faces.end())
{