summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-01-24 12:50:17 -0600
committerDave Parks <davep@lindenlab.com>2023-01-24 12:50:17 -0600
commita851aa83e705fa4a1c78919cfcac6709cfb1a875 (patch)
treef60abae0c94e459533f4f9f8b24564d1b260a6d9 /indra/newview/pipeline.cpp
parentbc6424779cda6ad03dbb59c2c14b91a7aa82bca9 (diff)
SL-18958 Fix for broken water distortion map and depth buffer. Incidental decruft.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp76
1 files changed, 30 insertions, 46 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 1ba139cd50..f0644cbbf5 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -841,62 +841,46 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
}
}
- if (LLPipeline::sRenderDeferred)
- {
- S32 shadow_detail = RenderShadowDetail;
- bool ssao = RenderDeferredSSAO;
+ S32 shadow_detail = RenderShadowDetail;
+ bool ssao = RenderDeferredSSAO;
- //allocate deferred rendering color buffers
- if (!mRT->deferredScreen.allocate(resX, resY, GL_RGBA, true, true, LLTexUnit::TT_TEXTURE, false, samples)) return false;
- if (!addDeferredAttachments(mRT->deferredScreen)) return false;
+ //allocate deferred rendering color buffers
+ if (!mRT->deferredScreen.allocate(resX, resY, GL_RGBA, true, true, LLTexUnit::TT_TEXTURE, false, samples)) return false;
+ if (!addDeferredAttachments(mRT->deferredScreen)) return false;
- GLuint screenFormat = GL_RGBA16;
+ GLuint screenFormat = GL_RGBA16;
- if (!mRT->screen.allocate(resX, resY, screenFormat, FALSE, true, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
+ if (!mRT->screen.allocate(resX, resY, screenFormat, FALSE, true, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
- mRT->deferredScreen.shareDepthBuffer(mRT->screen);
+ mRT->deferredScreen.shareDepthBuffer(mRT->screen);
- if (samples > 0)
- {
- if (!mRT->fxaaBuffer.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
- }
- else
- {
- mRT->fxaaBuffer.release();
- }
+ if (samples > 0)
+ {
+ if (!mRT->fxaaBuffer.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
+ }
+ else
+ {
+ mRT->fxaaBuffer.release();
+ }
- if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0)
- { //only need mRT->deferredLight for shadows OR ssao OR dof OR fxaa
- if (!mRT->deferredLight.allocate(resX, resY, GL_RGBA16, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE)) return false;
- }
- else
- {
- mRT->deferredLight.release();
- }
+ if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0)
+ { //only need mRT->deferredLight for shadows OR ssao OR dof OR fxaa
+ if (!mRT->deferredLight.allocate(resX, resY, GL_RGBA16, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE)) return false;
+ }
+ else
+ {
+ mRT->deferredLight.release();
+ }
- allocateShadowBuffer(resX, resY);
+ allocateShadowBuffer(resX, resY);
- //HACK make screenbuffer allocations start failing after 30 seconds
- if (gSavedSettings.getBOOL("SimulateFBOFailure"))
- {
- return false;
- }
- }
- else
+ //HACK make screenbuffer allocations start failing after 30 seconds
+ if (gSavedSettings.getBOOL("SimulateFBOFailure"))
{
- mRT->deferredLight.release();
-
- releaseSunShadowTargets();
- releaseSpotShadowTargets();
+ return false;
+ }
- mRT->fxaaBuffer.release();
- mRT->screen.release();
- mRT->deferredScreen.release(); //make sure to release any render targets that share a depth buffer with mRT->deferredScreen first
-
- if (!mRT->screen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_TEXTURE, FALSE)) return false;
- }
-
- gGL.getTexUnit(0)->disable();
+ gGL.getTexUnit(0)->disable();
stop_glerror();