From 7c17e52fbd532ec4db556b69b520d9372076e86d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 18 Dec 2021 20:19:55 +0200 Subject: [PATCH] Increment frame after destroying objects instead of before Things were getting destroyed one frame too early since the destroy queue is ticked after rendering a frame. --- source/backends/vulkan/destroyqueue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/backends/vulkan/destroyqueue.cpp b/source/backends/vulkan/destroyqueue.cpp index 0c3e17c1..32ec5cff 100644 --- a/source/backends/vulkan/destroyqueue.cpp +++ b/source/backends/vulkan/destroyqueue.cpp @@ -66,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(); @@ -75,6 +74,8 @@ void DestroyQueue::tick() allocator.release(e.memory_id); queue.pop_front(); } + + ++current_frame; } } // namespace GL -- 2.43.0