mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 08:00:14 +00:00
fix: free WMO and M2 material descriptor sets on group/model destroy to prevent pool exhaustion
This commit is contained in:
parent
4393798409
commit
f043077746
2 changed files with 9 additions and 2 deletions
|
|
@ -743,9 +743,10 @@ void M2Renderer::destroyModelGPU(M2ModelGPU& model) {
|
|||
VmaAllocator alloc = vkCtx_->getAllocator();
|
||||
if (model.vertexBuffer) { vmaDestroyBuffer(alloc, model.vertexBuffer, model.vertexAlloc); model.vertexBuffer = VK_NULL_HANDLE; }
|
||||
if (model.indexBuffer) { vmaDestroyBuffer(alloc, model.indexBuffer, model.indexAlloc); model.indexBuffer = VK_NULL_HANDLE; }
|
||||
VkDevice device = vkCtx_->getDevice();
|
||||
for (auto& batch : model.batches) {
|
||||
if (batch.materialSet) { vkFreeDescriptorSets(device, materialDescPool_, 1, &batch.materialSet); batch.materialSet = VK_NULL_HANDLE; }
|
||||
if (batch.materialUBO) { vmaDestroyBuffer(alloc, batch.materialUBO, batch.materialUBOAlloc); batch.materialUBO = VK_NULL_HANDLE; }
|
||||
// materialSet freed when pool is reset/destroyed
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue