summaryrefslogtreecommitdiff
path: root/indra/newview/lldynamictexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldynamictexture.cpp')
-rw-r--r--indra/newview/lldynamictexture.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index a27a98ff2c..f1145948a7 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -118,6 +118,8 @@ BOOL LLViewerDynamicTexture::render()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::preRender(BOOL clear_depth)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
+
//use the bottom left corner
mOrigin.set(0, 0);
@@ -181,19 +183,26 @@ void LLViewerDynamicTexture::postRender(BOOL success)
//-----------------------------------------------------------------------------
BOOL LLViewerDynamicTexture::updateAllInstances()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
+
sNumRenders = 0;
if (gGLManager.mIsDisabled)
{
return TRUE;
}
- bool use_fbo = gPipeline.mBake.isComplete() && !gGLManager.mIsAMD;
+ LLRenderTarget& bake_target = gPipeline.mAuxillaryRT.deferredScreen;
- if (use_fbo)
+ if (!bake_target.isComplete())
{
- gPipeline.mBake.bindTarget();
- gPipeline.mBake.clear();
+ llassert(false);
+ return FALSE;
}
+ llassert(bake_target.getWidth() >= LLPipeline::MAX_BAKE_WIDTH);
+ llassert(bake_target.getHeight() >= LLPipeline::MAX_BAKE_WIDTH);
+
+ bake_target.bindTarget();
+ bake_target.clear();
LLGLSLShader::unbind();
LLVertexBuffer::unbind();
@@ -208,11 +217,13 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
LLViewerDynamicTexture *dynamicTexture = *iter;
if (dynamicTexture->needsRender())
{
+ llassert(dynamicTexture->getFullWidth() <= LLPipeline::MAX_BAKE_WIDTH);
+ llassert(dynamicTexture->getFullHeight() <= LLPipeline::MAX_BAKE_WIDTH);
+
glClear(GL_DEPTH_BUFFER_BIT);
- gDepthDirty = TRUE;
gGL.color4f(1,1,1,1);
- dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mBake : nullptr);
+ dynamicTexture->setBoundTarget(&bake_target);
dynamicTexture->preRender(); // Must be called outside of startRender()
result = FALSE;
if (dynamicTexture->render())
@@ -229,10 +240,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
}
}
- if (use_fbo)
- {
- gPipeline.mBake.flush();
- }
+ bake_target.flush();
gGL.flush();