summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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())
{