Update Swapchain image count to obey present mode constraints#1081
Update Swapchain image count to obey present mode constraints#1081SRSaunders wants to merge 5 commits into
Conversation
|
Running this locally, I have noticed drops to 15 FPS and freezes on simple maps, such as testbox. Debian 12, RTX 4060 with 580.82.09 drivers. Next weekend I'll try to run it with optick and see what could be going on. Any tips on which debug cvars to enable for Vulkan? |
|
Thanks @klaussilveira for testing this, but I definitely was not expecting a performance hit. I haven't seen that when testing on Win, Linux, or Mac. I have a few questions:
I would like to try to duplicate this issue if possible, so any setup info you remember would be helpful. Thanks.
Scratch that, I renamed and compiled test_box using rbdmap. Loads and runs fine without any performance issues on macOS + AMD 6600XT. Will try Manjaro linux + AMD later today. Update: Test_box map works fine there too. I wonder if there’s a difference with Nvidia? However, please come back first with answers 1-4 above. |
|
This is not consistent at all, which makes me think it is some driver issue. I also intermittently get this crash: I can't pinpoint the cause yet. |
|
A couple of things:
UPDATE: I can't reproduce the binding set mismatch error on my Manjaro linux setup using an AMD 6600XT GPU, nor on macOS. If you can reproduce this error reliably, I can provide a few debugging changes to perhaps help track this down. Please advise. UPDATE 2: I may have found the binding set mismatch issue, but can't test the solution since I can't reliably reproduce. If you are still getting those mismatch errors, I can provide you with a patch to try out. Let me know. |
|
@klaussilveira I have created a new branch (off of master) with a possible fix for the binding set mismatch problem. I would appreciate if you could try this and see if those errors go away. Thanks. https://github.com/SRSaunders/RBDOOM-3-BFG/tree/bindingset-mismatch-fix If this works, I will post a separate PR. |
|
Nope, still happens: |
|
Hmm. I have a few more ideas. Try each of these separately:
|
|
|
|
Thanks @klaussilveira. Did you apply Actually, there is one more test you could do to help narrow things down. Revert the bool to false, and set |
|
UPDATE: I have deleted this test branch and will post a separate PR regarding the As far as I am concerned this PR above (Swapchain image count) is working fine and does not need any updates. |
This PR separates and updates how semaphores are used for Vulkan image acquisition and presentation sync. This follows best practices documented in https://docs.vulkan.org/guide/latest/swapchain_semaphore_reuse.html.
NUM_FRAME_DATAimage acquisition semaphores to match the number of frames-in-flight for the renderer, and continues to use a circular queue for cycling through image acquisition semaphores.VK_EXT_surface_maintenance1is available in the implementation, requestsminImageCountandmaxImageCountfor the specific presentation mode selected for the swapchain, and uses these to bound the requested swapchain image count during swapchain creation.m_SwapChainIndexreturned fromvkAcquireNextImageKHR()to index into the presentation semaphore vector when synchronizing withinvkPresentKHR(). This is to support potential out-of-order image acquisition which can occur in certain circumstances depending on the presentation engine.This PR also updates a macOS-specific item:
Fixes #1080.
Tested on Windows 11 Vulkan, Manjaro Linux, and macOS Sequoia.