-
Notifications
You must be signed in to change notification settings - Fork 453
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
Make vkDeviceWaitIdle stop a pending vkAcquireNextImageKHR Semaphore #1059
Comments
I don't think this is a good idea. AcquireNextImage is explicitly not a queue operation. DeviceWaitIdle() expicitly waits only for all device queues to idle, regardless of what naive users expect. Vulkan often surprises naive users, so I don't see why this case is special. The above motiviation can trivially be satisfied by inserting a QueueSubmit() waiting on the semaphore on any device queue, or by waiting on a fence from AcquireNextImage. I think the spec hole you're trying to plug is very unlikely to be an issue in practice, and certainly doesn't warrant special-casing the behavior in a way that has such broad implementation implications. |
But At least under an "as-if" clause that could always be the case. The implementation can have whatever internal foreign queues as much as it wants as long as it behaves in a healthy way towards the user of the API. I mean, how does the
which says it is not just what "naive users expect". It is practically spec recommendation.
One require to always demand otherwisely unnecessary Fence of
That's somewhat my point. |
vkAcquireNextImageKHR() was designed to be special from the start. It's an artifact of decoupling acquiring the next image to render to from presenting the prior image, one of the major goals of the WSI design (We saw this as a big improvement over SwapBuffers()). Trying to pretend it's not special doesn't improve the design. Trying to pretend it operates on a device queue when it explicitly does not doesn't improve the design. Asking Vulkan drivers to do special things under the hood that applications can do (and understand they must do, if reading the spec closely) to accomplish these goals doesn't improve the design either. We discussed this in the WSI group and the agreement was these semaphore signals are essentially the same as external semaphore signal operations, as I walked through in my comment on #152, and hence shouldn't be covered by vkDeviceWaitIdle(). Hence, closing the issue. |
Hm, shame. The above concerns sound too theoretical for me TBH. Meanwhile it will be a hassle and an error prone gotcha... I mean the logic is bit self-defeating. Why is there a Thanks. Had to try... |
I agree with @krOoze on this one . Every real world vulkan application will deal with swapchain recreation and inevitably run into this issue. It's not intuitive that |
@mokafolio Assuming the same problem does not apply to the fence in reality. Want me to reopen the Issue so you can try taking over to champion the issue? |
@krOoze Regarding the fence, I was thinking that it can't be optional and you'd have to explicitly wait for it when recreating the swap chain (as an alternative to relying on Let me think about this a little more, I will come back to you if I think this should be reopened! |
You can use the semaphore to later make a fence out of it. So the |
Could you elaborate what you mean with making a fence out of it? When not using a fence, the only way I could find (In your Hello_Triangle example by the way :) ) is to do an empty queue submission to make the |
Yea. You take the semaphore. You put it into PS: So the issue is at least not without a workaround unlike the #1678 |
Awesome, thanks for all the great input. Just to wrap things up for the time being: While the existing documentation for In my mind there are two solutions:
I prefer the former. |
I'm trying to understand how to resolve this issue but I am not sure (and things I tried didn't work). There seems to be a new extension except it's so new it's not supported by the driver so I can't even test it... |
@luxalpa The workaround is described above. If you get the dirty semaphore from |
I suggest to make
vkDeviceWaitIdle
be explicitly able to stop a pendingvkAcquireNextImageKHR
Semaphore and Fence. I.e. make valid:All
vkDeviceWaitIdle
says is:vkAcquireNextImageKHR
only says:In of itself IMO not sufficient to judge one way or other.
VkDevice
.Cons:
Motivation\Use Case:
The text was updated successfully, but these errors were encountered: