summaryrefslogtreecommitdiff
path: root/indra/llrender/llrendertarget.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-07-03 17:42:24 -0500
committerGitHub <noreply@github.com>2024-07-03 17:42:24 -0500
commit08b933a0c67463f06f124420f16c8a3f7dc83f1f (patch)
tree4ca6d47a6b055d332cb75646226c13e950f37ce4 /indra/llrender/llrendertarget.cpp
parent9a38ecee8ef54b3e85a88657d7ba96c3292e350e (diff)
#1870 Tune up for better experience on integrated intel with low memory (#1872)
* More deterministic vsize calculation. Add control for choosing downscale method. * Quick hack to make GLTF preview work again
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
-rw-r--r--indra/llrender/llrendertarget.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index efdde77a32..60159a0497 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -426,14 +426,17 @@ void LLRenderTarget::bindTarget()
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3};
- glDrawBuffers(static_cast<GLsizei>(mTex.size()), drawbuffers);
if (mTex.empty())
{ //no color buffer to draw to
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
}
-
+ else
+ {
+ glDrawBuffers(static_cast<GLsizei>(mTex.size()), drawbuffers);
+ glReadBuffer(GL_COLOR_ATTACHMENT0);
+ }
check_framebuffer_status();
glViewport(0, 0, mResX, mResY);
@@ -519,7 +522,8 @@ void LLRenderTarget::flush()
llassert(sCurFBO == mFBO);
llassert(sBoundTarget == this);
- if (mGenerateMipMaps == LLTexUnit::TMG_AUTO) {
+ if (mGenerateMipMaps == LLTexUnit::TMG_AUTO)
+ {
LL_PROFILE_GPU_ZONE("rt generate mipmaps");
bindTexture(0, 0, LLTexUnit::TFO_TRILINEAR);
glGenerateMipmap(GL_TEXTURE_2D);
@@ -540,6 +544,8 @@ void LLRenderTarget::flush()
glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]);
sCurResX = gGLViewport[2];
sCurResY = gGLViewport[3];
+ glReadBuffer(GL_BACK);
+ glDrawBuffer(GL_BACK);
}
}