mirror of
https://github.com/brl/mutter.git
synced 2025-01-22 09:29:25 +00:00
cogl: Generalize EGL context attribute initialization
No functional change, just makes the next change clearer. https://gitlab.gnome.org/GNOME/mutter/merge_requests/454
This commit is contained in:
parent
9ab3a02a8a
commit
3f29b47809
@ -351,6 +351,7 @@ try_create_context (CoglDisplay *display,
|
|||||||
EGLint cfg_attribs[MAX_EGL_CONFIG_ATTRIBS];
|
EGLint cfg_attribs[MAX_EGL_CONFIG_ATTRIBS];
|
||||||
GError *config_error = NULL;
|
GError *config_error = NULL;
|
||||||
const char *error_message;
|
const char *error_message;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
_COGL_RETURN_VAL_IF_FAIL (egl_display->egl_context == NULL, TRUE);
|
_COGL_RETURN_VAL_IF_FAIL (egl_display->egl_context == NULL, TRUE);
|
||||||
|
|
||||||
@ -388,24 +389,22 @@ try_create_context (CoglDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Try to get a core profile 3.1 context with no deprecated features */
|
/* Try to get a core profile 3.1 context with no deprecated features */
|
||||||
attribs[0] = EGL_CONTEXT_MAJOR_VERSION_KHR;
|
attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
|
||||||
attribs[1] = 3;
|
attribs[i++] = 3;
|
||||||
attribs[2] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
||||||
attribs[3] = 1;
|
attribs[i++] = 1;
|
||||||
attribs[4] = EGL_CONTEXT_FLAGS_KHR;
|
attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||||
attribs[5] = EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
attribs[i++] = EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||||
attribs[6] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||||
attribs[7] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||||
attribs[8] = EGL_NONE;
|
|
||||||
}
|
}
|
||||||
else if (display->renderer->driver == COGL_DRIVER_GLES2)
|
else if (display->renderer->driver == COGL_DRIVER_GLES2)
|
||||||
{
|
{
|
||||||
attribs[0] = EGL_CONTEXT_CLIENT_VERSION;
|
attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
|
||||||
attribs[1] = 2;
|
attribs[i++] = 2;
|
||||||
attribs[2] = EGL_NONE;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
attribs[0] = EGL_NONE;
|
attribs[i++] = EGL_NONE;
|
||||||
|
|
||||||
egl_display->egl_context = eglCreateContext (edpy,
|
egl_display->egl_context = eglCreateContext (edpy,
|
||||||
config,
|
config,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user