mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 18:08:08 +02:00
glamor: add core profile support to EGL glamor. (v2)
v1.1: use version defines.
v2: let glamor work it out itself
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 79c3925532)
This commit is contained in:
parent
181ea41e71
commit
b0fa782081
1 changed files with 22 additions and 4 deletions
|
|
@ -791,6 +791,15 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|||
#endif
|
||||
EGL_NONE
|
||||
};
|
||||
static const EGLint config_attribs_core[] = {
|
||||
EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR,
|
||||
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR,
|
||||
EGL_CONTEXT_MAJOR_VERSION_KHR,
|
||||
GLAMOR_GL_CORE_VER_MAJOR,
|
||||
EGL_CONTEXT_MINOR_VERSION_KHR,
|
||||
GLAMOR_GL_CORE_VER_MINOR,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
glamor_identify(0);
|
||||
glamor_egl = calloc(sizeof(*glamor_egl), 1);
|
||||
|
|
@ -851,12 +860,21 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|||
KHR_surfaceless_opengl);
|
||||
#endif
|
||||
|
||||
#ifndef GLAMOR_GLES2
|
||||
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
||||
NULL, EGL_NO_CONTEXT,
|
||||
config_attribs);
|
||||
if (glamor_egl->context == EGL_NO_CONTEXT) {
|
||||
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create EGL context\n");
|
||||
goto error;
|
||||
config_attribs_core);
|
||||
#else
|
||||
glamor_egl->context = NULL;
|
||||
#endif
|
||||
if (!glamor_egl->context) {
|
||||
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
||||
NULL, EGL_NO_CONTEXT,
|
||||
config_attribs);
|
||||
if (glamor_egl->context == EGL_NO_CONTEXT) {
|
||||
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create EGL context\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!eglMakeCurrent(glamor_egl->display,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue