summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolalpha.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-15 14:31:32 -0700
committerGraham Linden <graham@lindenlab.com>2019-03-15 14:31:32 -0700
commit69f5ab9004124a58e202425ab253a119e8e63e4b (patch)
treee1bcb6628491487d16c1c6055e74d0e33c136da0 /indra/newview/lldrawpoolalpha.cpp
parentd5f3e7f28e5ce0f7f1af611759a743c511e250c9 (diff)
Make alpha drawpool optimizations an opt-in render debug setting for the adventurous.
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r--indra/newview/lldrawpoolalpha.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 9f65a70a86..2efa208017 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -49,10 +49,6 @@
#include "llspatialpartition.h"
#include "llglcommonfunc.h"
-// These optimizations can and will induce lighting, texturing, and/or GL state bugs
-#define BATCH_FULLBRIGHTS 0
-#define BATCH_EMISSIVES 0
-
BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE;
static BOOL deferred_render = FALSE;
@@ -612,6 +608,8 @@ void LLDrawPoolAlpha::renderEmissives(U32 mask, std::vector<LLDrawInfo*>& emissi
void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
{
+ BOOL batch_fullbrights = gSavedSettings.getBOOL("RenderAlphaBatchFullbrights");
+ BOOL batch_emissives = gSavedSettings.getBOOL("RenderAlphaBatchEmissives");
BOOL initialized_lighting = FALSE;
BOOL light_enabled = TRUE;
@@ -671,13 +669,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
}
}
- #if BATCH_FULLBRIGHTS
- if (params.mFullbright)
+ if (params.mFullbright && batch_fullbrights)
{
fullbrights.push_back(&params);
continue;
}
- #endif
LLRenderPass::applyModelMatrix(params);
@@ -812,11 +808,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE))
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_EMISSIVE);
- #if BATCH_EMISSIVES
- emissives.push_back(&params);
- #else
- drawEmissiveInline(mask, &params);
- #endif
+
+ if (batch_emissives)
+ {
+ emissives.push_back(&params);
+ }
+ else
+ {
+ drawEmissiveInline(mask, &params);
+ }
}
if (tex_setup)
@@ -828,15 +828,17 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
}
}
- #if BATCH_FULLBRIGHTS
+ if (batch_fullbrights)
+ {
light_enabled = false;
renderFullbrights(mask, fullbrights);
- #endif
+ }
- #if BATCH_EMISSIVES
+ if (batch_emissives)
+ {
light_enabled = true;
renderEmissives(mask, emissives);
- #endif
+ }
if (current_shader)
{