From 2cc8e2ba06815246c60dde97a277982ab95fe682 Mon Sep 17 00:00:00 2001 From: Beq Date: Thu, 6 Oct 2022 22:11:30 +0100 Subject: [PATCH] FIX logic errors in texture batching two errors result in poor use of draw buffers when batching alpha textures. --- indra/newview/llvovolume.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 06bb42e0e0..690c677254 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -6643,10 +6643,10 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace LLMaterialPtr mat = te->getMaterialParams(); LLMaterialID matId = te->getMaterialID(); - if (distance_sort) - { - tex = NULL; - } + // if (distance_sort) + // { + // tex = NULL; + // } if (last_tex == tex) { @@ -6731,7 +6731,11 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace tex = facep->getTexture(); - if (texture_count < MAX_TEXTURE_COUNT) + // Quick hack test of proper batching logic + // if (texture_count < MAX_TEXTURE_COUNT) + // only add to the batch if this is a new texture + if (cur_tex == texture_count && texture_count < MAX_TEXTURE_COUNT) + // { texture_list[texture_count++] = tex; }