Skip to content

[ERROR: Validation] Semaphore is being signaled by VkQueue but it may still be in use by VkSwapchainKHR #140

Open

Description

@y0gi

Had a "Semaphore is being signaled by VkQueue but it may still be in use by VkSwapchainKHR" error, after a bit of investigation it turns out to be caused by the example framework. In the example framework present_ready and render_complete are hard wired for three semaphores, and vulkan does not always return three swapchain images. I fixed this as follows;

    - vuk::Unique<std::array<VkSemaphore, 3>> present_ready;
    - vuk::Unique<std::array<VkSemaphore, 3>> render_complete;
    + vuk::Unique<std::vector<VkSemaphore>> present_ready;
    + vuk::Unique<std::vector<VkSemaphore>> render_complete;
    - present_ready = vuk::Unique<std::array<VkSemaphore, 3>>(*superframe_allocator);
    - render_complete = vuk::Unique<std::array<VkSemaphore, 3>>(*superframe_allocator);
    + present_ready = vuk::Unique<std::vector<VkSemaphore>>(*superframe_allocator);
    + present_ready->resize(swapchain->images.size());
    + render_complete = vuk::Unique<std::vector<VkSemaphore>>(*superframe_allocator);
    + render_complete->resize(swapchain->images.size());
    - bundle = *acquire_one(*context, swapchain, (*present_ready)[context->get_frame_count() % 3], (*render_complete)[context->get_frame_count() % 3]);
    + bundle = *acquire_one(*context, swapchain, (*present_ready)[context->get_frame_count() % (*present_ready).size()], (*render_complete)[context->get_frame_count() % (*render_complete).size()]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions