From: Mikko Rasa Date: Sat, 18 Dec 2021 18:19:55 +0000 (+0200) Subject: Increment frame after destroying objects instead of before X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7c17e52fbd532ec4db556b69b520d9372076e86d;p=libs%2Fgl.git 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. --- 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