Skip to content
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

Recreate swap chain when suboptimal to avoid error spam #72859

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Feb 7, 2023

The spec is pretty vague about when VK_SUBOPTIMAL_KHR can be produced by vkAcquireNextImageKHR. But it means that the swapchain format no longer matches the window format, but the driver can use it anyway. For some windowing system/driver combinations this can take place on a resize of the window, or a change in format, or just from focus being lost. The presence of the error may indicate that performance will be impacted, but in some cases performance won't be impacted. In any case, the error doesn't go away until a new swap chain is constructed.

On my development device I regularly get the error spammed when running projects. With this change the swapchain is updated once and the error is not printed again.

CC @RandomShaper

Tagged as 4.x as this isn't fixing a known bug but is rather cleaning up an annoyance. It should be merged after 4.0 stable

@clayjohn clayjohn added this to the 4.x milestone Feb 7, 2023
@clayjohn clayjohn requested a review from a team as a code owner February 7, 2023 21:48
@akien-mga akien-mga modified the milestones: 4.x, 4.1 Apr 3, 2023
@akien-mga akien-mga merged commit 253b487 into godotengine:master Apr 3, 2023
@akien-mga
Copy link
Member

Thanks!

@clayjohn clayjohn deleted the VK-suboptimal branch April 3, 2023 15:20
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.3.

jpcerrone added a commit to jpcerrone/godot that referenced this pull request Jun 14, 2023
Fixes godotengine#77790
Adds missing 'break' statement to 'VulkanContext::prepare_buffers' function.
It was mistakenly removed in godotengine#72859
YuriSizov pushed a commit to YuriSizov/godot that referenced this pull request Jul 20, 2023
Fixes godotengine#77790
Adds missing 'break' statement to 'VulkanContext::prepare_buffers' function.
It was mistakenly removed in godotengine#72859

(cherry picked from commit bd786ce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants