diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2023-04-19 15:56:01 -0700 |
---|---|---|
committer | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2023-04-20 11:23:44 -0700 |
commit | 95d07ccd8799808036528f8cd09288d83fc0c7e0 (patch) | |
tree | 381e2d9652555815bcc75febe8946c4a7be60409 /indra/newview/lldrawpool.cpp | |
parent | acc6655845d17e05150ceb92e4d145616eefea72 (diff) |
SL-19598: Fix shadows not having textures for PBR/non-rigged/alpha blended prims
Diffstat (limited to 'indra/newview/lldrawpool.cpp')
-rw-r--r-- | indra/newview/lldrawpool.cpp | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index c61618c056..2eb277fc4e 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -452,21 +452,26 @@ void LLRenderPass::pushGLTFBatches(U32 type) LLDrawInfo& params = **i; LLCullResult::increment_iterator(i, end); - auto& mat = params.mGLTFMaterial; + pushGLTFBatch(params); + } +} - mat->bind(params.mTexture); +void LLRenderPass::pushGLTFBatch(LLDrawInfo& params) +{ + auto& mat = params.mGLTFMaterial; - LLGLDisable cull_face(mat->mDoubleSided ? GL_CULL_FACE : 0); + mat->bind(params.mTexture); - setup_texture_matrix(params); - - applyModelMatrix(params); + LLGLDisable cull_face(mat->mDoubleSided ? GL_CULL_FACE : 0); - params.mVertexBuffer->setBuffer(); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); + setup_texture_matrix(params); + + applyModelMatrix(params); - teardown_texture_matrix(params); - } + params.mVertexBuffer->setBuffer(); + params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); + + teardown_texture_matrix(params); } void LLRenderPass::pushRiggedGLTFBatches(U32 type) @@ -483,28 +488,20 @@ void LLRenderPass::pushRiggedGLTFBatches(U32 type) LLDrawInfo& params = **i; LLCullResult::increment_iterator(i, end); - auto& mat = params.mGLTFMaterial; - - mat->bind(params.mTexture); - - LLGLDisable cull_face(mat->mDoubleSided ? GL_CULL_FACE : 0); - - setup_texture_matrix(params); - - applyModelMatrix(params); - - if (params.mAvatar.notNull() && (lastAvatar != params.mAvatar || lastMeshId != params.mSkinInfo->mHash)) - { - uploadMatrixPalette(params); - lastAvatar = params.mAvatar; - lastMeshId = params.mSkinInfo->mHash; - } - - params.mVertexBuffer->setBuffer(); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); + pushRiggedGLTFBatch(params, lastAvatar, lastMeshId); + } +} - teardown_texture_matrix(params); +void LLRenderPass::pushRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvatar, U64& lastMeshId) +{ + if (params.mAvatar.notNull() && (lastAvatar != params.mAvatar || lastMeshId != params.mSkinInfo->mHash)) + { + uploadMatrixPalette(params); + lastAvatar = params.mAvatar; + lastMeshId = params.mSkinInfo->mHash; } + + pushGLTFBatch(params); } void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures) |