summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-04-24 12:34:05 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-04-28 10:36:26 -0700
commit6b83fabf729fd9d866fb150166cbd0af50f7f99d (patch)
tree9ea1a506e68808cf1109df7ce14311611ee8711d
parentb21e16f27d215cd2e564af7c48cba86459d07645 (diff)
SL-19644: Move GLTF transform reset out of pushBatch
-rw-r--r--indra/newview/lldrawpool.cpp22
-rw-r--r--indra/newview/lldrawpool.h12
-rw-r--r--indra/newview/lldrawpoolbump.cpp4
-rw-r--r--indra/newview/lldrawpoolbump.h2
-rw-r--r--indra/newview/pipeline.cpp17
5 files changed, 28 insertions, 29 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index edabb55cc3..8eb88dc3cd 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -444,7 +444,7 @@ void LLRenderPass::renderRiggedGroup(LLSpatialGroup* group, U32 type, bool textu
}
}
-void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
+void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{};
@@ -465,11 +465,11 @@ void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures, bool
}
}
#endif
- pushBatch(*pparams, texture, batch_textures, reset_gltf);
+ pushBatch(*pparams, texture, batch_textures);
}
}
-void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
+void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLVOAvatar* lastAvatar = nullptr;
@@ -500,12 +500,11 @@ void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures
lastMeshId = pparams->mSkinInfo->mHash;
}
- pushBatch(*pparams, texture, batch_textures, reset_gltf);
- reset_gltf = false;
+ pushBatch(*pparams, texture, batch_textures);
}
}
-void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
+void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{};
@@ -526,12 +525,11 @@ void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures,
}
#endif
LLGLSLShader::sCurBoundShaderPtr->setMinimumAlpha(pparams->mAlphaMaskCutoff);
- pushBatch(*pparams, texture, batch_textures, reset_gltf);
- reset_gltf = false;
+ pushBatch(*pparams, texture, batch_textures);
}
}
-void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
+void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLVOAvatar* lastAvatar = nullptr;
@@ -573,8 +571,7 @@ void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_text
lastMeshId = pparams->mSkinInfo->mHash;
}
- pushBatch(*pparams, texture, batch_textures, reset_gltf);
- reset_gltf = false;
+ pushBatch(*pparams, texture, batch_textures);
}
}
@@ -600,7 +597,7 @@ void LLRenderPass::resetGLTFTextureTransform()
LLGLSLShader::sCurBoundShaderPtr->uniform4fv(LLShaderMgr::TEXTURE_BASE_COLOR_TRANSFORM, 2, (F32*)ignore_gltf_transform);
}
-void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures, bool reset_gltf)
+void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
if (!params.mCount)
@@ -609,7 +606,6 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textur
}
applyModelMatrix(params);
- if (reset_gltf) { resetGLTFTextureTransform(); }
bool tex_setup = false;
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 8704f2e340..38132e0793 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -349,17 +349,17 @@ public:
void resetDrawOrders() { }
static void applyModelMatrix(const LLDrawInfo& params);
+ // Use before a non-GLTF batch if it is interleaved with GLTF batches that share the same shader
static void resetGLTFTextureTransform();
- virtual void pushBatches(U32 type, bool texture = true, bool batch_textures = false, bool reset_gltf = false);
- virtual void pushRiggedBatches(U32 type, bool texture = true, bool batch_textures = false, bool reset_gltf = false);
+ virtual void pushBatches(U32 type, bool texture = true, bool batch_textures = false);
+ virtual void pushRiggedBatches(U32 type, bool texture = true, bool batch_textures = false);
void pushGLTFBatches(U32 type);
void pushGLTFBatch(LLDrawInfo& params);
void pushRiggedGLTFBatches(U32 type);
void pushRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvatar, U64& lastMeshId);
- virtual void pushMaskBatches(U32 type, bool texture = true, bool batch_textures = false, bool reset_gltf = false);
- virtual void pushRiggedMaskBatches(U32 type, bool texture = true, bool batch_textures = false, bool reset_gltf = false);
- // reset_gltf: batch is interleaved with GLTF batches that share the same shader
- virtual void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false, bool reset_gltf = false);
+ virtual void pushMaskBatches(U32 type, bool texture = true, bool batch_textures = false);
+ virtual void pushRiggedMaskBatches(U32 type, bool texture = true, bool batch_textures = false);
+ virtual void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false);
static bool uploadMatrixPalette(LLDrawInfo& params);
static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo);
virtual void renderGroup(LLSpatialGroup* group, U32 type, bool texture = true);
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 75b47b2c22..a548740ec4 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1254,15 +1254,13 @@ void LLDrawPoolBump::pushBumpBatches(U32 type)
}
}
-void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures, bool reset_gltf)
+void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
applyModelMatrix(params);
bool tex_setup = false;
- if (reset_gltf) { LLRenderPass::resetGLTFTextureTransform(); }
-
if (batch_textures && params.mTextureList.size() > 1)
{
for (U32 i = 0; i < params.mTextureList.size(); ++i)
diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h
index 41c4879ded..840af0c99d 100644
--- a/indra/newview/lldrawpoolbump.h
+++ b/indra/newview/lldrawpoolbump.h
@@ -53,7 +53,7 @@ public:
LLDrawPoolBump();
/*virtual*/ void prerender() override;
- void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false, bool reset_gltf = false) override;
+ void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false) override;
void pushBumpBatches(U32 type);
void renderGroup(LLSpatialGroup* group, U32 type, bool texture) override;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c482256309..1768c6ee5f 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6797,7 +6797,8 @@ void LLPipeline::renderAlphaObjects(bool rigged)
lastMeshId = pparams->mSkinInfo->mHash;
}
- mSimplePool->pushBatch(*pparams, true, true, true);
+ LLRenderPass::resetGLTFTextureTransform();
+ mSimplePool->pushBatch(*pparams, true, true);
}
}
else
@@ -6808,7 +6809,8 @@ void LLPipeline::renderAlphaObjects(bool rigged)
}
else
{
- mSimplePool->pushBatch(*pparams, true, true, true);
+ LLRenderPass::resetGLTFTextureTransform();
+ mSimplePool->pushBatch(*pparams, true, true);
}
}
}
@@ -6825,11 +6827,11 @@ void LLPipeline::renderMaskedObjects(U32 type, bool texture, bool batch_texture,
gGLLastMatrix = NULL;
if (rigged)
{
- mAlphaMaskPool->pushRiggedMaskBatches(type+1, texture, batch_texture, true);
+ mAlphaMaskPool->pushRiggedMaskBatches(type+1, texture, batch_texture);
}
else
{
- mAlphaMaskPool->pushMaskBatches(type, texture, batch_texture, true);
+ mAlphaMaskPool->pushMaskBatches(type, texture, batch_texture);
}
gGL.loadMatrix(gGLModelView);
gGLLastMatrix = NULL;
@@ -6843,11 +6845,11 @@ void LLPipeline::renderFullbrightMaskedObjects(U32 type, bool texture, bool batc
gGLLastMatrix = NULL;
if (rigged)
{
- mFullbrightAlphaMaskPool->pushRiggedMaskBatches(type+1, texture, batch_texture, true);
+ mFullbrightAlphaMaskPool->pushRiggedMaskBatches(type+1, texture, batch_texture);
}
else
{
- mFullbrightAlphaMaskPool->pushMaskBatches(type, texture, batch_texture, true);
+ mFullbrightAlphaMaskPool->pushMaskBatches(type, texture, batch_texture);
}
gGL.loadMatrix(gGLModelView);
gGLLastMatrix = NULL;
@@ -8909,6 +8911,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
{
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("shadow alpha masked");
LL_PROFILE_GPU_ZONE("shadow alpha masked");
+ LLRenderPass::resetGLTFTextureTransform();
renderMaskedObjects(LLRenderPass::PASS_ALPHA_MASK, true, true, rigged);
}
@@ -8925,6 +8928,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
gDeferredShadowFullbrightAlphaMaskProgram.bind(rigged);
LLGLSLShader::sCurBoundShaderPtr->uniform1f(LLShaderMgr::DEFERRED_SHADOW_TARGET_WIDTH, (float)target_width);
LLGLSLShader::sCurBoundShaderPtr->uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0);
+ LLRenderPass::resetGLTFTextureTransform();
renderFullbrightMaskedObjects(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, true, true, rigged);
}
@@ -8941,6 +8945,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
{
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("shadow alpha material");
LL_PROFILE_GPU_ZONE("shadow alpha material");
+ LLRenderPass::resetGLTFTextureTransform();
renderMaskedObjects(LLRenderPass::PASS_NORMSPEC_MASK, true, false, rigged);
renderMaskedObjects(LLRenderPass::PASS_MATERIAL_ALPHA_MASK, true, false, rigged);
renderMaskedObjects(LLRenderPass::PASS_SPECMAP_MASK, true, false, rigged);