fix: vb ib indirect should be shared. (#15062)

This commit is contained in:
Zach Lee
2023-05-17 15:44:53 +08:00
committed by GitHub
parent 96c4927a28
commit 43f835b7bd
+2 -10
View File
@@ -207,15 +207,9 @@ void RenderingSubMesh::enableVertexIdChannel(gfx::Device *device) {
}
bool RenderingSubMesh::destroy() {
for (auto *vertexBuffer : _vertexBuffers) {
vertexBuffer->destroy();
}
_vertexBuffers.clear();
if (_indexBuffer && _isOwnerOfIndexBuffer) {
_indexBuffer->destroy();
_indexBuffer = nullptr;
}
_indexBuffer = nullptr;
_indirectBuffer = nullptr;
if (!_jointMappedBuffers.empty() && !_jointMappedBufferIndices.empty()) {
for (uint32_t index : _jointMappedBufferIndices) {
@@ -224,8 +218,6 @@ bool RenderingSubMesh::destroy() {
_jointMappedBuffers.clear();
_jointMappedBufferIndices.clear();
}
CC_SAFE_DESTROY_NULL(_indirectBuffer);
return true;
}