summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-24 10:53:04 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-24 10:53:04 -0700
commit1529c16201d332ce7bbff5c3637737ca58277eb9 (patch)
treef8337ec21ff2d52f646a5d2146dc673d93048ded /indra/newview
parentb507d63566e8896af702dd10f5643dc29068a8a9 (diff)
SL-11610
Revert attempted fix for 10625.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldynamictexture.cpp20
-rw-r--r--indra/newview/lldynamictexture.h5
-rw-r--r--indra/newview/llviewerdisplay.cpp30
-rw-r--r--indra/newview/llviewertexlayer.h2
-rw-r--r--indra/newview/pipeline.cpp4
-rw-r--r--indra/newview/pipeline.h2
6 files changed, 21 insertions, 42 deletions
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 13d539b55f..fa9a0712fa 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -129,7 +129,7 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth)
llassert(mFullHeight <= 512);
llassert(mFullWidth <= 512);
- if (gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete() && !gGLManager.mIsATI)
+ if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI)
{ //using offscreen render target, just use the bottom left corner
mOrigin.set(0, 0);
}
@@ -213,15 +213,14 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
sNumRenders = 0;
if (gGLManager.mIsDisabled || LLPipeline::sMemAllocationThrottled)
{
- return FALSE;
+ return TRUE;
}
- bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete() && !gGLManager.mIsATI;
+ bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI;
if (use_fbo)
{
- gPipeline.mBake.bindTarget();
- gPipeline.mBake.clear();
+ gPipeline.mWaterDis.bindTarget();
}
LLGLSLShader::bindNoShader();
@@ -241,7 +240,6 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
gDepthDirty = TRUE;
gGL.color4f(1,1,1,1);
- dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mBake : nullptr);
dynamicTexture->preRender(); // Must be called outside of startRender()
result = FALSE;
if (dynamicTexture->render())
@@ -250,23 +248,19 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
result = TRUE;
sNumRenders++;
}
- //gGL.flush();
+ gGL.flush();
LLVertexBuffer::unbind();
- dynamicTexture->setBoundTarget(nullptr);
+
dynamicTexture->postRender(result);
}
}
}
- glFinish();
-
if (use_fbo)
{
- gPipeline.mBake.flush();
+ gPipeline.mWaterDis.flush();
}
- gGL.flush();
-
return ret;
}
diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h
index 4bd74a8425..f3f57c9a6b 100644
--- a/indra/newview/lldynamictexture.h
+++ b/indra/newview/lldynamictexture.h
@@ -88,9 +88,6 @@ public:
static BOOL updateAllInstances();
static void destroyGL() ;
static void restoreGL() ;
-
- void setBoundTarget(LLRenderTarget* target) { mBoundTarget = target; }
-
protected:
void generateGLTexture();
void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE);
@@ -100,8 +97,6 @@ protected:
LLCoordGL mOrigin;
LL_ALIGN_16(LLCamera mCamera);
- LLRenderTarget* mBoundTarget;
-
typedef std::set<LLViewerDynamicTexture*> instance_list_t;
static instance_list_t sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
static S32 sNumRenders;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 0eafce7e1c..b78937e3b0 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -592,6 +592,18 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// Actually push all of our triangles to the screen.
//
+ // do render-to-texture stuff here
+ if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES))
+ {
+ LLAppViewer::instance()->pingMainloopTimeout("Display:DynamicTextures");
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_DYNAMIC_TEXTURES);
+ if (LLViewerDynamicTexture::updateAllInstances())
+ {
+ gGL.setColorMask(true, true);
+ glClear(GL_DEPTH_BUFFER_BIT);
+ }
+ }
+
gViewerWindow->setup3DViewport();
gPipeline.resetFrameStats(); // Reset per-frame statistics.
@@ -1022,26 +1034,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (!for_snapshot)
{
render_ui();
- }
-
- // do render-to-texture stuff here
- if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES))
- {
- LLAppViewer::instance()->pingMainloopTimeout("Display:DynamicTextures");
- LL_RECORD_BLOCK_TIME(FTM_UPDATE_DYNAMIC_TEXTURES);
- if (LLViewerDynamicTexture::updateAllInstances())
- {
- gGL.setColorMask(true, true);
- glClear(GL_DEPTH_BUFFER_BIT);
- }
- }
-
- LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI");
- if (!for_snapshot)
- {
swap();
}
+
LLSpatialGroup::sNoDelete = FALSE;
gPipeline.clearReferences();
diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h
index dec7f0ddfc..027ae255ec 100644
--- a/indra/newview/llviewertexlayer.h
+++ b/indra/newview/llviewertexlayer.h
@@ -111,7 +111,7 @@ protected:
// Pass these along for tex layer rendering.
virtual void preRender(BOOL clear_depth) { preRenderTexLayerSet(); }
virtual void postRender(BOOL success) { postRenderTexLayerSet(success); }
- virtual BOOL render() { return renderTexLayerSet(mBoundTarget); }
+ virtual BOOL render() { return renderTexLayerSet(); }
//--------------------------------------------------------------------
// Updates
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 448b65272b..fc7408a8e5 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1162,7 +1162,6 @@ void LLPipeline::releaseGLBuffers()
mWaterRef.release();
mWaterDis.release();
- mBake.release();
mHighlight.release();
for (U32 i = 0; i < 3; i++)
@@ -1226,9 +1225,6 @@ void LLPipeline::createGLBuffers()
mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE,LLTexUnit::TT_TEXTURE);
}
- // Use FBO for bake tex
- mBake.allocate(512, 512, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, true);
-
mHighlight.allocate(256,256,GL_RGBA, FALSE, FALSE);
stop_glerror();
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index cc9ec06f80..b0c40d145b 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -650,8 +650,6 @@ public:
//water distortion texture (refraction)
LLRenderTarget mWaterDis;
- LLRenderTarget mBake;
-
//texture for making the glow
LLRenderTarget mGlow[3];