summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolsimple.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-03 10:42:19 -0800
committerGraham Linden <graham@lindenlab.com>2019-03-03 10:42:19 -0800
commit4c3050a3953153aa8753fc10706ad2ef464f3e3d (patch)
tree78ded9c452348f749c8dac87f416aa433f4ca963 /indra/newview/lldrawpoolsimple.cpp
parentd90b16d350fba72e5011768ee8eb8b3289962dc5 (diff)
SL-10664, SL-10666
Fix up culling issues from perf work and fix Depth of Field rendering to get depth values properly. Baseline for performance work.
Diffstat (limited to 'indra/newview/lldrawpoolsimple.cpp')
-rw-r--r--indra/newview/lldrawpoolsimple.cpp115
1 files changed, 114 insertions, 1 deletions
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 606e44185f..f653920662 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -47,6 +47,14 @@ void LLDrawPoolGlow::beginPostDeferredPass(S32 pass)
{
gDeferredEmissiveProgram.bind();
gDeferredEmissiveProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ gDeferredEmissiveProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ gDeferredEmissiveProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
static LLTrace::BlockTimerStatHandle FTM_RENDER_GLOW_PUSH("Glow Push");
@@ -119,6 +127,15 @@ void LLDrawPoolGlow::render(S32 pass)
shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.f);
}
+ if (LLPipeline::sRenderingHUDs)
+ {
+ shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
gGL.setColorMask(false, true);
@@ -170,6 +187,15 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass)
if (mShaderLevel > 0)
{
simple_shader->bind();
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
else
{
@@ -263,6 +289,15 @@ void LLDrawPoolAlphaMask::beginRenderPass(S32 pass)
if (mShaderLevel > 0)
{
simple_shader->bind();
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
else
{
@@ -296,6 +331,15 @@ void LLDrawPoolAlphaMask::render(S32 pass)
simple_shader->bind();
simple_shader->setMinimumAlpha(0.33f);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
pushMaskBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
pushMaskBatches(LLRenderPass::PASS_MATERIAL_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
pushMaskBatches(LLRenderPass::PASS_SPECMAP_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
@@ -336,6 +380,15 @@ void LLDrawPoolFullbrightAlphaMask::beginRenderPass(S32 pass)
if (mShaderLevel > 0)
{
simple_shader->bind();
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
else
{
@@ -372,10 +425,12 @@ void LLDrawPoolFullbrightAlphaMask::render(S32 pass)
if (LLPipeline::sRenderingHUDs)
{
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
simple_shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
}
else
{
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
if (LLPipeline::sRenderDeferred)
{
simple_shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
@@ -407,6 +462,15 @@ void LLDrawPoolSimple::beginDeferredPass(S32 pass)
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED);
gDeferredDiffuseProgram.bind();
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ gDeferredDiffuseProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ gDeferredDiffuseProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
void LLDrawPoolSimple::endDeferredPass(S32 pass)
@@ -445,6 +509,16 @@ void LLDrawPoolAlphaMask::renderDeferred(S32 pass)
LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK_DEFERRED);
gDeferredDiffuseAlphaMaskProgram.bind();
gDeferredDiffuseAlphaMaskProgram.setMinimumAlpha(0.33f);
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ gDeferredDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ gDeferredDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
pushMaskBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
gDeferredDiffuseAlphaMaskProgram.unbind();
}
@@ -481,6 +555,14 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass)
{
simple_shader->bind();
simple_shader->setMinimumAlpha(0.5f);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
else
{
@@ -537,7 +619,16 @@ void LLDrawPoolGrass::renderDeferred(S32 pass)
LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS_DEFERRED);
gDeferredNonIndexedDiffuseAlphaMaskProgram.bind();
gDeferredNonIndexedDiffuseAlphaMaskProgram.setMinimumAlpha(0.5f);
- gDeferredNonIndexedDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ gDeferredNonIndexedDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ gDeferredNonIndexedDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
//render grass
LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask());
}
@@ -564,6 +655,15 @@ void LLDrawPoolFullbright::beginPostDeferredPass(S32 pass)
else
{
gDeferredFullbrightProgram.bind();
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ gDeferredFullbrightProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ gDeferredFullbrightProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
}
@@ -632,6 +732,15 @@ void LLDrawPoolFullbright::render(S32 pass)
fullbright_shader->uniform1f(LLViewerShaderMgr::FULLBRIGHT, 1.f);
fullbright_shader->uniform1f(LLViewerShaderMgr::TEXTURE_GAMMA, 1.f);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ fullbright_shader->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ fullbright_shader->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXTURE_INDEX;
pushBatches(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask, TRUE, TRUE);
pushBatches(LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE, fullbright_mask, TRUE, TRUE);
@@ -666,6 +775,7 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
{
gObjectFullbrightAlphaMaskProgram.bind();
gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ gObjectFullbrightAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
}
else if (LLPipeline::sRenderDeferred)
{
@@ -673,17 +783,20 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
{
gDeferredFullbrightAlphaMaskWaterProgram.bind();
gDeferredFullbrightAlphaMaskWaterProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ gDeferredFullbrightAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 1);
}
else
{
gDeferredFullbrightAlphaMaskProgram.bind();
gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ gDeferredFullbrightAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
}
}
else
{
gObjectFullbrightAlphaMaskProgram.bind();
gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ gObjectFullbrightAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 0);
}
}