#vulkan+sdl2 vk.AcquireNextImageKHR sync issue when resizing

18 messages · Page 1 of 1 (latest)

vagrant edge
#

I have followed Vulkan Tutorial up until page 144, right before the "Handling minimization" section.
My program works, except for the fact that when I try to resize the window too much too quickly, my program hangs, and I get this validation error message:

[ERROR] --- [2025-01-29 15:40:22] [5208] VULKAN - VALIDATION: Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01286 ] Object 0: handle = 0x9fde6b0000000014, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0xe9e4b2a9 | vkAcquireNextImageKHR():  Semaphore must not be currently signaled.
The Vulkan spec states: If semaphore is not VK_NULL_HANDLE, it must be unsignaled (https://vulkan.lunarg.com/doc/view/1.3.296.0/linux/1.3-extensions/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01286)

I have attached my draw code in a file to this post.

The things I'm doing differently:

  • using the .Graphics queue to present, instead of using a .Present queue
  • not recreating the swapchain if there's a presentation error. (res := vk.QueuePresentKHR(gc.queues[.Graphics], &present_info)). But even if I do, the same error still happens.

Does anybody know why I get this error?

tranquil cobalt
#

do you have a zip of the full program?

vagrant edge
#

I can make one. give me a moment.

tranquil cobalt
vagrant edge
tranquil cobalt
#

is this the behavior you were doing when you got the error?

vagrant edge
#

yes, the erratic resizing.

tranquil cobalt
#

🤔 let me look at the code

#

hard to debug because I don't get the error

vagrant edge
#

what window manager are you using?

tranquil cobalt
#

kde

vagrant edge
#

ok Ill try to install something else and try the same thing. Ill be back asap

tranquil cobalt
#

no rush or anything

tranquil cobalt
#

can you try destroying the swapchain before recreating the swapchain