Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swapchain recreation: Semaphore is left signaled #388

Open
V-Fries opened this issue Aug 18, 2024 · 0 comments
Open

Swapchain recreation: Semaphore is left signaled #388

V-Fries opened this issue Aug 18, 2024 · 0 comments

Comments

@V-Fries
Copy link

V-Fries commented Aug 18, 2024

Inside the drawFrame() function in the chapter "Swap chain recreation" during the acquisition of the next image index:

VkResult result = vkAcquireNextImageKHR(device, swapChain, UINT64_MAX, imageAvailableSemaphores[currentFrame], VK_NULL_HANDLE, &imageIndex);

if (result == VK_ERROR_OUT_OF_DATE_KHR) {
    recreateSwapChain();
    return;
} else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
    throw std::runtime_error("failed to acquire swap chain image!");
}

In the case vkAcquireNextImageKHR() returns VK_ERROR_OUT_OF_DATE_KHR the drawFrame() function will return with imageAvailableSemaphores[currentFrame] being signaled which causes the following validation error during the next iteration:

[Validation layer][ERROR][VALIDATION]: "Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01286 ] Object 0: handle = 0xe7f79a0000000005, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0xe9e4b2a9 | vkAcquireNextImage
KHR():  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.283.0/mac/1.3-extensions/vkspec.html#VUID-vkAcquire
NextImageKHR-semaphore-01286)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant