diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-06-18 13:21:41 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-06-26 13:48:49 +0200 |
commit | 54d208ffdae20fd2bee745a037607a762d3a82a9 (patch) | |
tree | 2cc5d2d839d530b1db608194eeb97aea4ffe3e55 /ui/egl-context.c | |
parent | 595123df1d54ed8fbab9e1a73d5a58c5bb71058f (diff) |
Add gles support to egl-helpers, wire up in egl-headless and gtk.
Add support for OpenGL ES to egl-helpers. Wire up the new option for
egl-headless and gtk UIs. egl-headless actually works fine. gtk hits a
not-yet implemented code path in libEGL when trying to use gles mode:
libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.
(This is mesa 17.2.3).
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Message-id: 20180618112141.23398-1-kraxel@redhat.com
Diffstat (limited to 'ui/egl-context.c')
-rw-r--r-- | ui/egl-context.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/egl-context.c b/ui/egl-context.c index 2161969abe..78e6c7ab7c 100644 --- a/ui/egl-context.c +++ b/ui/egl-context.c @@ -6,15 +6,22 @@ QEMUGLContext qemu_egl_create_context(DisplayChangeListener *dcl, QEMUGLParams *params) { EGLContext ctx; - EGLint ctx_att[] = { + EGLint ctx_att_core[] = { EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT, EGL_CONTEXT_CLIENT_VERSION, params->major_ver, EGL_CONTEXT_MINOR_VERSION_KHR, params->minor_ver, EGL_NONE }; + EGLint ctx_att_gles[] = { + EGL_CONTEXT_CLIENT_VERSION, params->major_ver, + EGL_CONTEXT_MINOR_VERSION_KHR, params->minor_ver, + EGL_NONE + }; + bool gles = (qemu_egl_mode == DISPLAYGL_MODE_ES); ctx = eglCreateContext(qemu_egl_display, qemu_egl_config, - eglGetCurrentContext(), ctx_att); + eglGetCurrentContext(), + gles ? ctx_att_gles : ctx_att_core); return ctx; } |