diff options
-rw-r--r-- | src/gallium/state_trackers/dri/dri_context.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 14 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c index fe3240ae1fa..84b88073c0e 100644 --- a/src/gallium/state_trackers/dri/dri_context.c +++ b/src/gallium/state_trackers/dri/dri_context.c @@ -72,9 +72,6 @@ dri_create_context(gl_api api, const struct gl_config * visual, attribs.major = major_version; attribs.minor = minor_version; - if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) - attribs.flags |= ST_CONTEXT_FLAG_DEBUG; - if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0) attribs.flags |= ST_CONTEXT_FLAG_FORWARD_COMPATIBLE; break; @@ -83,6 +80,9 @@ dri_create_context(gl_api api, const struct gl_config * visual, goto fail; } + if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) + attribs.flags |= ST_CONTEXT_FLAG_DEBUG; + if (flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_FORWARD_COMPATIBLE)) { *error = __DRI_CTX_ERROR_UNKNOWN_FLAG; goto fail; diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 02499f2daec..d6e875fcfeb 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -376,19 +376,17 @@ driCreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - /* The EGL_KHR_create_context spec says: + /* The latest version of EGL_KHR_create_context spec says: * - * "Flags are only defined for OpenGL context creation, and specifying - * a flags value other than zero for other types of contexts, - * including OpenGL ES contexts, will generate an error." + * "If the EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR flag bit is set in + * EGL_CONTEXT_FLAGS_KHR, then a <debug context> will be created. + * [...] This bit is supported for OpenGL and OpenGL ES contexts. * - * The GLX_EXT_create_context_es2_profile specification doesn't say - * anything specific about this case. However, none of the known flags - * have any meaning in an ES context, so this seems safe. + * None of the other flags have any meaning in an ES context, so this seems safe. */ if (mesa_api != API_OPENGL_COMPAT && mesa_api != API_OPENGL_CORE - && flags != 0) { + && (flags & ~__DRI_CTX_FLAG_DEBUG)) { *error = __DRI_CTX_ERROR_BAD_FLAG; return NULL; } |