forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The original code had two bugs: 1. It assumed Swapchain count can be used for proper CPU/GPU synchronization (it's not) 2. It used a double buffer scheme (FRAME_LAG = 2) but the vkWaitForFences/vkResetFences calls were in the wrong order and in the wrong place 3. The swapchain bug forced a quad-buffer scheme with roughly 1 or 2 frames of wait; which hid all the issues This commit gets rid of RenderingDeviceVulkan::frame_count & RenderingDeviceVulkan::frame which should've never existed and makes everything depend on VulkanContext::frame_index & VulkanContext::FRAME_LAG Add ability to tweak FRAME_LAG from within Project Settings Adds new setting display/window/vsync/buffer_count Adds new setting display/window/vsync/swapchain_count See godotengine#80550 for details ------------------------------------------------------------------ Fix comment grammar Use Godot's functions instead of std ------------------------------------------------------------------ Additionally handle inconsistent state when destroying windows: window.image_acquired_semaphores[i] contains uninitialized values. This means that if VulkanContext::_update_swap_chain had failed early (this can happen for valid reasons and due to unexpected failures) then _clean_up_swap_chain will try to destroy an invalid handle. This fix always sets the handle to VK_NULL_HANDLE. Likewise perform the checks in various other resources in _clean_up_swap_chain in case the resources were partially initialized and are now in an inconsistent state. The API should guarantee the call to be valid if the handle was VK_NULL_HANDLE, but I don't trust driver implementations to handle that case. Affects godotengine#81670 Co-authored-by: Clay John <[email protected]>
- Loading branch information
1 parent
26b1fd0
commit 7f71a42
Showing
7 changed files
with
127 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.