summaryrefslogtreecommitdiff
path: root/indra/newview/lldynamictexture.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-06-11 08:37:03 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-06-11 08:37:43 +0300
commit534605eb228c8b9ab9df0137394f3f55b7f7b022 (patch)
treecaed3347d6780d73ac2b66296552fedc0a9f7938 /indra/newview/lldynamictexture.cpp
parentd1cf13f31e75807500aff0cf49812a76aff2bd74 (diff)
parenta73773bc1abdac6bc3beea36fd4ba58eba686e13 (diff)
Merge branch 'main' (featurette) into inventory_favorites
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();