-
Notifications
You must be signed in to change notification settings - Fork 931
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
Vulkan Swapchain and Submit Synchronization Incorrect #5559
Comments
The use of relaxed atomics in there seems very strange to me. I can't imagine how one could get away with not caring about which values concurrent threads would see for
This sounds like something akin to |
So I thought about that, and you can wait and signal the same timeline semaphore, but we can't assume timeline semaphores exist, so we'd need a binary semaphore fallback anyway. |
Right - my point being, |
We need a timeline semaphore with a |
We are currently using a single ping-pong semaphore (I'm calling this set of two semaphores a "relay semaphore") for all of our synchronization between acquire/present and between submissions. This is wrong for multiple reasons.
First using the same relay semaphore for both the submit -> present barrier and the submit -> submit barrier means that a single semaphore is being waited on twice. The act of waiting on a semaphore also resets the semaphore, so waiting on a single semaphore twice results in undefined behavior.
Second we are using the same relay semaphore for all acquire -> submit -> present cycles. This would be fine if we could guarantee that the previously used submit had finished its wait and the semaphore was reset by the time we scheduled the following acquire, but we can't. We need to have N relay semaphores, one per acquire cycle, until we can prove that the least-recently-used semaphore is finished being used.
I have provided the diagram of how submission synchronization needs to work with lines. Blue lines are swapchain relay semaphores (one set per frame). Orange lines are submit -> submit relay semaphore (a single one on the device.
Possibly related:
The text was updated successfully, but these errors were encountered: