Skip to content

winit: Probe for OpenGL 2.0 before selecting the FemtoVG renderer - #13397

Open
tronical wants to merge 1 commit into
masterfrom
simon/win32-fallback
Open

tronical wants to merge 1 commit into
masterfrom
simon/win32-fallback

Conversation

@tronical

Copy link
Copy Markdown
Member

Windows always has an opengl32.dll, but in virtual machines it often provides only OpenGL 1.1. Creating a context through glutin succeeds there and only the missing glCreateShader gives it away. That check ran in resume(), after the window adapter was created with the FemtoVG renderer, so the backend could no longer fall back.

Probe for glCreateShader with a throwaway window in new_suspended() instead. The renderer creation then fails early enough for the fallback chain to reach the software renderer.

Only a WGL context that lacks glCreateShader proves that the driver is a GL 1.1 stub. If the probe itself can't run, glutin may still reach a working driver through EGL, so leave the choice to it.

Closes #12706

ChangeLog: Windows: fall back to another renderer when the OpenGL driver doesn't support OpenGL 2.0

Windows always has an opengl32.dll, but in virtual machines it often
provides only OpenGL 1.1. Creating a context through glutin succeeds
there and only the missing glCreateShader gives it away. That check ran
in resume(), after the window adapter was created with the FemtoVG
renderer, so the backend could no longer fall back.

Probe for glCreateShader with a throwaway window in new_suspended()
instead. The renderer creation then fails early enough for the fallback
chain to reach the software renderer.

Only a WGL context that lacks glCreateShader proves that the driver is a
GL 1.1 stub. If the probe itself can't run, glutin may still reach a
working driver through EGL, so leave the choice to it.

Closes #12706

ChangeLog: Windows: fall back to another renderer when the OpenGL driver doesn't support OpenGL 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: automatically select the software renderer if OpenGL 2.0 is not available

1 participant