summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpool.cpp')
-rw-r--r--indra/newview/lldrawpool.cpp57
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)