summaryrefslogtreecommitdiff
path: root/indra
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
parentd5f3e7f28e5ce0f7f1af611759a743c511e250c9 (diff)
Make alpha drawpool optimizations an opt-in render debug setting for the adventurous.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml22
-rw-r--r--indra/newview/lldrawpoolalpha.cpp34
2 files changed, 40 insertions, 16 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 088bc3dfac..c0dcafdd51 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8558,6 +8558,28 @@
</array>
</map>
+ <key>RenderAlphaBatchFullbrights</key>
+ <map>
+ <key>Comment</key>
+ <string>Render fullbright alpha content more efficiently, but with possible visual differences from prev viewers.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>RenderAlphaBatchEmissives</key>
+ <map>
+ <key>Comment</key>
+ <string>Render emissive alpha content more efficiently, but with possible visual differences from prev viewers.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>RenderAnisotropic</key>
<map>
<key>Comment</key>
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)
{