diff options
| author | Ryan Zhang <ryan.zhang@nxp.com> | 2026-05-15 19:21:55 +0800 |
|---|---|---|
| committer | Michael Tokarev <mjt@tls.msk.ru> | 2026-06-24 16:35:14 +0300 |
| commit | 5ce8ce8ae1096eda47cd0248c614f1025a8da1dc (patch) | |
| tree | fbb3a784bd667cf3b223738cfdfce20dfe0e48f8 | |
| parent | 97455be94191df1399dae35b1c2ba5b957ead949 (diff) | |
| download | qemu-5ce8ce8ae1096eda47cd0248c614f1025a8da1dc.tar.gz qemu-5ce8ce8ae1096eda47cd0248c614f1025a8da1dc.zip | |
ui/sdl2: Set GL ES profile before creating initial GL context
When the user selects GLES via '-display sdl,gl=es', we need to set
SDL_GL_CONTEXT_PROFILE_MASK to SDL_GL_CONTEXT_PROFILE_ES before
calling SDL_GL_CreateContext(). This ensures SDL_GL_LoadLibrary()
loads the correct GLES driver instead of the desktop OpenGL driver.
Fix the below issue: qemu-system-aarch64: /usr/src/debug/libepoxy
/1.5.10/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion
`0 && "Couldn't find current GLX or EGL context.\n"' failed.
sdl2_gl_create_context() already sets the profile mask correctly for
ES mode, but the initial context created in sdl2_window_create() is
missing the same treatment.
Fixes:da3f7a3ab9ea0091955b58f8909dfcee01f4043e ("ui/sdl: try to instantiate the matching opengl renderer")
Signed-off-by: ryan.zhang@nxp.com
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <DU2PR04MB9018BB3650BA218438C01F2A83042@DU2PR04MB9018.eurprd04.prod.outlook.com>
(cherry picked from commit 490a3e1867f025c68fa13db766b5c8da16c6eca4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| -rw-r--r-- | ui/sdl2.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -109,6 +109,8 @@ void sdl2_window_create(struct sdl2_console *scon) if (scon->opts->gl == DISPLAY_GL_MODE_ES) { driver = "opengles2"; + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_CONTEXT_PROFILE_ES); } SDL_SetHint(SDL_HINT_RENDER_DRIVER, driver); |
