|
@@ -74,12 +74,17 @@ namespace love {
|
|
|
if (textureImage == VK_NULL_HANDLE)
|
|
|
return;
|
|
|
|
|
|
- // FIXME: objects for deletion should probably be put on a queue
|
|
|
- // instead of greedy waiting here.
|
|
|
- vkDeviceWaitIdle(device);
|
|
|
- vkDestroySampler(device, textureSampler, nullptr);
|
|
|
- vkDestroyImageView(device, textureImageView, nullptr);
|
|
|
- vmaDestroyImage(allocator, textureImage, textureImageAllocation);
|
|
|
+ vgfx->queueCleanUp([
|
|
|
+ device = device,
|
|
|
+ textureSampler = textureSampler,
|
|
|
+ textureImageView = textureImageView,
|
|
|
+ allocator = allocator,
|
|
|
+ textureImage = textureImage,
|
|
|
+ textureImageAllocation = textureImageAllocation] () {
|
|
|
+ vkDestroySampler(device, textureSampler, nullptr);
|
|
|
+ vkDestroyImageView(device, textureImageView, nullptr);
|
|
|
+ vmaDestroyImage(allocator, textureImage, textureImageAllocation);
|
|
|
+ });
|
|
|
|
|
|
textureImage = VK_NULL_HANDLE;
|
|
|
}
|