bkaradzic / bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
https://bkaradzic.github.io/bgfx/overview.html
BSD 2-Clause "Simplified" License
14.59k stars 1.92k forks source link

Make the semaphore pool larger, such that there are enough for any number of swapchain images AND frames in flight. #3307

Closed mcourteaux closed 3 weeks ago

mcourteaux commented 3 weeks ago

Constructed this together with @pezcode.

This very simple change fixes the issue on my device.

Summary:

This fixes #3302 and replaces #3303.

bkaradzic commented 3 weeks ago

It doesn't look like fix. There should be association between semaphore that's queued and semaphore that's about to be used. And then before passing semaphore to vkAcquireNextImageKHR it should be waited for queue that would wait for this semaphore. This wait would be noop in most of cases since there is enough semaphores, but it would be proper synchronization for those cases where queue is not finished.