summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-05-31 14:35:59 -0500
committerDave Parks <davep@lindenlab.com>2011-05-31 14:35:59 -0500
commitece32418e7c1828a65c88e526a5afcb635c5453a (patch)
tree3c1cb5315a354371b75d98d79f97a98d078815c4 /indra/newview/llvovolume.cpp
parent522a28d12721e1cc2e7f726882baa79be97d55fa (diff)
SH-1682 Dynamically adjust the number of texture channels to use for indexed texture rendering based on available hardware.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index ed6edbb65b..125283d474 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4455,6 +4455,14 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
buffer_index = -1;
}
+ S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity
+
+ if (LLPipeline::sRenderDeferred && distance_sort)
+ {
+ texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels;
+ }
+
+
while (face_iter != faces.end())
{
//pull off next face
@@ -4521,11 +4529,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
else
{
cur_tex++;
-
- if (cur_tex >= 7 && facep->getTextureEntry()->getShiny())
- { //entry 7 is reserved for the environment map for shiny faces
- break;
- }
}
if (!can_batch_texture(facep))
@@ -4534,8 +4537,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
break;
}
- if (cur_tex >= 8)
- { //cut batches on every 8 textures
+ if (cur_tex >= texture_index_channels)
+ { //cut batches when index channels are depleted
break;
}