]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/destroyqueue.cpp
Rewrite descriptor set management
[libs/gl.git] / source / backends / vulkan / destroyqueue.cpp
index bdfea43253418e833ca64c1865fee15bbfdd98eb..929f89c6070196caee4ca9b17533bccdb16a6021 100644 (file)
@@ -20,6 +20,11 @@ void DestroyQueue::destroy(VkBuffer handle, unsigned mem_id)
        destroy<VkBuffer, &VulkanFunctions::DestroyBuffer>(handle, mem_id);
 }
 
+void DestroyQueue::destroy(VkDescriptorPool handle)
+{
+       destroy<VkDescriptorPool, &VulkanFunctions::DestroyDescriptorPool>(handle);
+}
+
 void DestroyQueue::destroy(VkFence handle)
 {
        destroy<VkFence, &VulkanFunctions::DestroyFence>(handle);
@@ -30,11 +35,21 @@ void DestroyQueue::destroy(VkFramebuffer handle)
        destroy<VkFramebuffer, &VulkanFunctions::DestroyFramebuffer>(handle);
 }
 
+void DestroyQueue::destroy(VkImage handle, unsigned mem_id)
+{
+       destroy<VkImage, &VulkanFunctions::DestroyImage>(handle, mem_id);
+}
+
 void DestroyQueue::destroy(VkImageView handle)
 {
        destroy<VkImageView, &VulkanFunctions::DestroyImageView>(handle);
 }
 
+void DestroyQueue::destroy(VkSampler handle)
+{
+       destroy<VkSampler, &VulkanFunctions::DestroySampler>(handle);
+}
+
 void DestroyQueue::destroy(VkSemaphore handle)
 {
        destroy<VkSemaphore, &VulkanFunctions::DestroySemaphore>(handle);
@@ -56,7 +71,6 @@ void DestroyQueue::tick()
        const VulkanFunctions &vk = device.get_functions();
        MemoryAllocator &allocator = device.get_allocator();
 
-       ++current_frame;
        while(!queue.empty() && current_frame>=queue.front().on_frame)
        {
                const Entry &e = queue.front();
@@ -65,6 +79,8 @@ void DestroyQueue::tick()
                        allocator.release(e.memory_id);
                queue.pop_front();
        }
+
+       ++current_frame;
 }
 
 } // namespace GL