From cae8aa6ecf231302653091162aa0e13e06c25696 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Thu, 18 May 2023 18:03:17 -0500 Subject: SL-19726 Fix for llTargetOmega on child prim breaking shadow rendering. Incidental decruft. --- indra/newview/lldrawpool.cpp | 76 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) (limited to 'indra/newview/lldrawpool.cpp') diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 187e290066..a9f35b3360 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -420,6 +420,27 @@ void LLRenderPass::renderRiggedGroup(LLSpatialGroup* group, U32 type, bool textu } void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + if (texture) + { + auto* begin = gPipeline.beginRenderMap(type); + auto* end = gPipeline.endRenderMap(type); + for (LLCullResult::drawinfo_iterator i = begin; i != end; ) + { + LLDrawInfo* pparams = *i; + LLCullResult::increment_iterator(i, end); + + pushBatch(*pparams, texture, batch_textures); + } + } + else + { + pushUntexturedBatches(type); + } +} + +void LLRenderPass::pushUntexturedBatches(U32 type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; auto* begin = gPipeline.beginRenderMap(type); @@ -429,11 +450,42 @@ void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures) LLDrawInfo* pparams = *i; LLCullResult::increment_iterator(i, end); - pushBatch(*pparams, texture, batch_textures); - } + pushUntexturedBatch(*pparams); + } } void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + + if (texture) + { + LLVOAvatar* lastAvatar = nullptr; + U64 lastMeshId = 0; + auto* begin = gPipeline.beginRenderMap(type); + auto* end = gPipeline.endRenderMap(type); + for (LLCullResult::drawinfo_iterator i = begin; i != end; ) + { + LLDrawInfo* pparams = *i; + LLCullResult::increment_iterator(i, end); + + if (pparams->mAvatar.notNull() && (lastAvatar != pparams->mAvatar || lastMeshId != pparams->mSkinInfo->mHash)) + { + uploadMatrixPalette(*pparams); + lastAvatar = pparams->mAvatar; + lastMeshId = pparams->mSkinInfo->mHash; + } + + pushBatch(*pparams, texture, batch_textures); + } + } + else + { + pushUntexturedRiggedBatches(type); + } +} + +void LLRenderPass::pushUntexturedRiggedBatches(U32 type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; LLVOAvatar* lastAvatar = nullptr; @@ -452,7 +504,7 @@ void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures lastMeshId = pparams->mSkinInfo->mHash; } - pushBatch(*pparams, texture, batch_textures); + pushUntexturedBatch(*pparams); } } @@ -523,6 +575,8 @@ void LLRenderPass::applyModelMatrix(const LLDrawInfo& params) void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + llassert(texture); + if (!params.mCount) { return; @@ -532,7 +586,6 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textur bool tex_setup = false; - if (texture) { if (batch_textures && params.mTextureList.size() > 1) { @@ -576,6 +629,21 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textur } } +void LLRenderPass::pushUntexturedBatch(LLDrawInfo& params) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + + if (!params.mCount) + { + return; + } + + applyModelMatrix(params); + + params.mVertexBuffer->setBuffer(); + params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); +} + // static bool LLRenderPass::uploadMatrixPalette(LLDrawInfo& params) { -- cgit v1.2.3