summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-05-18 14:08:24 -0400
committerNat Goodspeed <nat@lindenlab.com>2022-05-18 14:08:24 -0400
commitc0aa1a1202678fdde0206c9372fb071c028cfe5b (patch)
tree614a5e0b9e24343c59709a9378050b601dd0f828 /indra/newview/pipeline.cpp
parent06aa68c2fbcd83cb00465c9f14933bda276b11e8 (diff)
parenta9363222618a879dd7d0d78471f8773af6b61618 (diff)
SL-17219: Merge 'DRTVWR-546' of lindenlab/viewer into SL-17219
Update task branch from main project branch.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index bc0d89f4ad..e142a40f1d 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -361,10 +361,12 @@ static LLCullResult* sCull = NULL;
void validate_framebuffer_object();
-
-bool addDeferredAttachments(LLRenderTarget& target)
+// Add color attachments for deferred rendering
+// target -- RenderTarget to add attachments to
+// for_impostor -- whether or not these render targets are for an impostor (if true, avoids implicit sRGB conversions)
+bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false)
{
- return target.addColorAttachment(GL_SRGB8_ALPHA8) && //specular
+ return target.addColorAttachment(for_impostor ? GL_RGBA : GL_SRGB8_ALPHA8) && //specular
target.addColorAttachment(GL_RGB10_A2); //normal+z
}
@@ -10996,14 +10998,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar)
if (!avatar->mImpostor.isComplete())
{
+ avatar->mImpostor.allocate(resX, resY, GL_RGBA, TRUE, FALSE);
+
if (LLPipeline::sRenderDeferred)
{
- avatar->mImpostor.allocate(resX,resY,GL_SRGB8_ALPHA8,TRUE,FALSE);
- addDeferredAttachments(avatar->mImpostor);
- }
- else
- {
- avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE);
+ addDeferredAttachments(avatar->mImpostor, true);
}
gGL.getTexUnit(0)->bind(&avatar->mImpostor);