]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/destroyqueue.cpp
Reset staging buffers in TransferQueue once the transfers are done
[libs/gl.git] / source / backends / vulkan / destroyqueue.cpp
index bdfea43253418e833ca64c1865fee15bbfdd98eb..32ec5cff580bd32ce2e8e0c72d9c2f4a8d14e7c0 100644 (file)
@@ -30,11 +30,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 +66,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 +74,8 @@ void DestroyQueue::tick()
                        allocator.release(e.memory_id);
                queue.pop_front();
        }
+
+       ++current_frame;
 }
 
 } // namespace GL