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

Validation fails to report failure details after swapchain was invalidated. #512

Closed
alexander-a-kharlamov opened this issue Dec 8, 2018 · 2 comments
Assignees
Milestone

Comments

@alexander-a-kharlamov
Copy link

In one of my demos I was getting an occasional validation errors:
[ UNASSIGNED-CoreValidation-DrawState-SwapchainTooManyImages ] Object: 0x2 (Type = 27) | vkAcquireNextImageKHR: Application has already acquired the maximum number of images (0x1)
[ UNASSIGNED-CoreValidation-DrawState-QueueForwardProgress ] Object: 0x77 (Type = 5) | Queue 0x1cdf7a0ca60 is waiting on semaphore 0x77 that has no way to be signaled.

While VL reports errors it doesn't provide several important details:

  1. VL didn't report an error on vkQueuePresentKHR that was preceding the failing vkAcquireNextImageKHR. The source error happened on presentation and Vulkan returned an error code: -1000001004 which signals that the swap chain presentation request failed because swapchain is no longer valid (in my case it was resized). VL didn't report that failure although I had the following bits set: VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_DEBUG_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT
    I think this sort of errors should be called out at least under WARNING, something like: Presentation failed because swapchain was invalidated. Applicaiton is responsible for recreating the swapchain now, and subsequent calls using swapchain will fail.

  2. The vkAcquireNextImageKHR validation error reports that the maximum number of images got acquired which is incorrect. The correct error message should be: "There are no images in the swapchain, because it's invalid, go recreate the swapchain". The vkAcquireNextImageKHR actually reports the same error code -1000001004, which VL should report inside it's messaging.

  3. The subsequent queue error is caused by the fact, that a failed vkAcquireNextImageKHR will not signal the semaphore. It would be beneficial for me to see a message about this in VL output as well. A messag e on a failed vkAcquireNextImageKHR should be extended to say: "Because the vkAcquireNextImageKHR failed, the semaphore will not be signaled."

  4. Last but not least, the error happened because my demo would create the swapchain and then switch to fullscreen mode. This somehow invalidated the swapchain on the first presentation call, and not on the first vkAcquireNextImageKHR. I am not sure if it's feasible for VLs to catch that, and it would be great if it is.

@mark-lunarg
Copy link
Contributor

mark-lunarg commented Dec 17, 2018

@alexander-a-kharlamov, thanks for the issue. In general, the validation layers avoid generating messages for failure codes documented in the specification. The parameter validation layer previously warned on non-success return codes, but this capability was removed due to overwhelming user feedback. There is an existing issue and plan to implement these checks as part of the Assistant Layer (#24): "Add warnings for non-success driver return values".
Similarly, as far as it is practical, we attempt to do the same for warnings. The assistant layer tracking issue also calls out an item "#2089 No error when recreating swapchain while rendering to an existing swapchain image" which will hopefully cover the warnings that would help in this situation. Please feel free to comment on #24 to add ideas for additional warnings or information.

@jzulauf-lunarg
Copy link
Contributor

The desired warnings have been added to #24 . There are no Valid Use violation, or incomplete VU checks. Closing.

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

4 participants