vulkan: fix clean up

We now don't do any more greedy waiting when destroying vulkan objects.
This commit is contained in:
niki
2022-07-29 22:59:15 +02:00
parent 524e011133
commit 1096b76054
6 changed files with 36 additions and 27 deletions
+4 -7
View File
@@ -46,13 +46,10 @@ namespace love {
if (buffer == VK_NULL_HANDLE)
return;
Graphics* vgfx = (Graphics*)gfx;
auto device = vgfx->getDevice();
// FIXME: objects for deletion should probably be put on a queue
// instead of greedy waiting here.
vkDeviceWaitIdle(device);
vmaDestroyBuffer(allocator, buffer, allocation);
auto vgfx = (Graphics*)gfx;
vgfx->queueCleanUp([allocator=allocator, buffer=buffer, allocation=allocation](){
vmaDestroyBuffer(allocator, buffer, allocation);
});
buffer = VK_NULL_HANDLE;
}