Skip to content

Strange clipping behavior in vulkan demo #821

@maxbol

Description

@maxbol

When compiling/running the glfw_vulkan demo on NixOS 25.05 with the glfw, vulkan-loader, and vulkan-headers packages installed, I get the following weird clipping behavior:

2025-06-28.22-56-45.mp4

For comparison, the glfw_opengl4 demo works perfectly for me.

I am sometimes getting a bunch of warnings like this from the validation layer:

Swapchain image 2 was presented but was not re-acquired, so VkSemaphore 0x310000000031 may still be in use and cannot be safely reused with image index 3.
Vulkan insight: One solution is to assign each image its own semaphore. Here are some common methods to ensure that a semaphore passed to vkQueuePresentKHR is not in use and can be safely reused:
        a) Use a separate semaphore per swapchain image. Index these semaphores using the index of the acquired image.
        b) Consider the VK_EXT_swapchain_maintenance1 extension. It allows using a VkFence with the presentation operation.
The Vulkan spec states: Each binary semaphore element of the pSignalSemaphores member of any element of pSubmits must be unsignaled when the semaphore signal operation it defines is executed on the device (https://docs.vulkan.org/spec/latest/chapters/cmdbuffers.html#VUID-vkQueueSubmit-pSignalSemaphores-00067)
validation layer: vkQueueSubmit(): pSubmits[0].pSignalSemaphores[0] (VkSemaphore 0x310000000031) is being signaled by VkQueue 0x1eb83170, but it may still be in use by VkSwapchainKHR 0x50000000005.
Here are the most recently acquired image indices: 0, 1, 2, [3], 4.
(brackets mark the last use of VkSemaphore 0x310000000031 in a presentation operation)

Sometimes these warnings does not show up. In either case, the demo is broken in the way shown in the mp4 attached above.

What could this be about?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions