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

Clear Window before blitting Viewport in gl_compatibility renderer #73300

Merged
merged 1 commit into from Feb 15, 2023

Conversation

clayjohn
Copy link
Member

Fixes: #71799

In Godot 3.x we had an API to draw black bars on the side of the window if some amount of the window was left uncovered by the Viewport. This covered up the leftover colored pixels from previous frames. In Godot 4.0 we got rid of that API as it is not needed for Vulkan which has to recreate the swapchain each time the window resizes.

Instead of bringing back the black bars we just clear the window if any section is left uncovered. Clearing to zero is a special operation on most drivers and is much faster than issuing 2 draw calls, plus the full screen clear signals that we don't care about the previous contents which can be a performance benefit in some cases.

A potential optimization would be to track window size and only clear on window size changes. However, I do not think it is worth the added complexity.

@clayjohn clayjohn added this to the 4.0 milestone Feb 14, 2023
@clayjohn clayjohn requested review from a team as code owners February 14, 2023 18:34
@akien-mga akien-mga merged commit eff6508 into godotengine:master Feb 15, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants