Improve vulkan resource freeing

and some minor improvements to the Renderer, now taking in an
AssetRef<Pipeline> as parameter.
This commit is contained in:
Thraix
2024-10-11 20:06:22 +02:00
parent dc735c4df7
commit ecc11f07db
21 changed files with 151 additions and 58 deletions
+8 -3
View File
@@ -75,9 +75,14 @@ namespace Copium
Font::~Font()
{
vkDestroyImage(Vulkan::GetDevice(), image, nullptr);
vkFreeMemory(Vulkan::GetDevice(), imageMemory, nullptr);
vkDestroyImageView(Vulkan::GetDevice(), imageView, nullptr);
VkImage imageCpy = image;
VkDeviceMemory imageMemoryCpy = imageMemory;
VkImageView imageViewCpy = imageView;
Vulkan::GetDevice().QueueIdleCommand([imageCpy, imageMemoryCpy, imageViewCpy]() {
vkDestroyImage(Vulkan::GetDevice(), imageCpy, nullptr);
vkFreeMemory(Vulkan::GetDevice(), imageMemoryCpy, nullptr);
vkDestroyImageView(Vulkan::GetDevice(), imageViewCpy, nullptr);
});
}
VkDescriptorImageInfo Font::GetDescriptorImageInfo(int index) const