# HG changeset patch # User sam # Date 1711907330 -25200 # Node ID a540a64b6990e1ecc155e36a67188f1c903fdc1d # Parent 4692be6e07eb612e60f0a20329c196cd291b983f fix: swapchain recreating had a bug diff -r 4692be6e07eb -r a540a64b6990 semicongine/renderer.nim --- a/semicongine/renderer.nim Mon Apr 01 00:34:34 2024 +0700 +++ b/semicongine/renderer.nim Mon Apr 01 00:48:50 2024 +0700 @@ -413,8 +413,9 @@ scene.clearDirtyShaderGlobals() proc startNewFrame*(renderer: var Renderer) = - # this is kinda important as we will wait for the queue finished fence from the swapchain - if not renderer.swapchain.acquireNextFrame(): + # TODO: chance for an infinity-loop + while not renderer.swapchain.acquireNextFrame(): + checkVkResult renderer.device.vk.vkDeviceWaitIdle() let res = renderer.swapchain.recreate() if not res.isSome: raise newException(Exception, "Unable to recreate swapchain") diff -r 4692be6e07eb -r a540a64b6990 semicongine/vulkan/commandbuffer.nim --- a/semicongine/vulkan/commandbuffer.nim Mon Apr 01 00:34:34 2024 +0700 +++ b/semicongine/vulkan/commandbuffer.nim Mon Apr 01 00:48:50 2024 +0700 @@ -82,7 +82,6 @@ commandBufferPool.destroy() - proc destroy*(commandpool: var CommandBufferPool) = assert commandpool.device.vk.valid assert commandpool.vk.valid