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

Windows: Update ANGLE surface size when window is resized #94428

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

alvinhochun
Copy link
Contributor

@alvinhochun alvinhochun commented Jul 16, 2024

ANGLE needs to be told to resize the DXGI swap chain using eglWaitNative. Otherwise the resize will only happen in eglSwapBuffers, which causes some janky stretching during window resize.


See: https://github.com/google/angle/blob/43ecf2bd98fc9dd135c82d6b153e18bf1fbcaf37/src/libANGLE/renderer/d3d/DisplayD3D.cpp#L401

This only fixes part of the issue because DisplayServerWindows does not currently force update and redraw during resize, which I aim to address separately.

Demo (GIF)

Before:
before

After: (the slowness is probably from being a debug build)
after

Fixes #94951

`WM_WINDOWPOSCHANGED` may be received before `CreateWindowExW` has even
returned, when the window's rendering context or OpenGL context hasn't
been created yet.
ANGLE needs to be told to resize the DXGI swap chain using
`eglWaitNative`. Otherwise the resize will only happen in
`eglSwapBuffers`, which causes some janky stretching during window
resize.
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

Would be good if @bruvzg took a look as well

@bruvzg bruvzg self-requested a review July 24, 2024 15:40
@bruvzg bruvzg modified the milestones: 4.4, 4.3 Jul 31, 2024
@akien-mga akien-mga added the bug label Jul 31, 2024
@akien-mga akien-mga merged commit 3fce516 into godotengine:master Jul 31, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@alvinhochun alvinhochun deleted the windows-angle-resize-sync branch July 31, 2024 12:37
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.

Windows ARM64 version of Godot 4.3 RC1 breaks UI scaling when resizing windows in GL Compatibility / ANGLE
5 participants