diff options
Diffstat (limited to 'src/glx/dri_common.c')
-rw-r--r-- | src/glx/dri_common.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 854733a5be..6307d65411 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -499,6 +499,12 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, case GLX_CONTEXT_FLAGS_ARB: *flags = attribs[i * 2 + 1]; break; + case GLX_CONTEXT_OPENGL_NO_ERROR_ARB: + if (attribs[i * 2 + 1]) { + *flags |= __DRI_CTX_FLAG_NO_ERROR; + printf("no_error enabled\n"); + } + break; case GLX_CONTEXT_PROFILE_MASK_ARB: profile = attribs[i * 2 + 1]; got_profile = true; @@ -567,7 +573,8 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, /* Unknown flag value. */ if (*flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_FORWARD_COMPATIBLE - | __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)) { + | __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS + | __DRI_CTX_FLAG_NO_ERROR)) { *error = __DRI_CTX_ERROR_UNKNOWN_FLAG; return false; } @@ -592,4 +599,33 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, return true; } +_X_HIDDEN bool +dri2_check_no_error(uint32_t flags, struct glx_context *share_context) +{ + Bool noError = flags & __DRI_CTX_FLAG_NO_ERROR; + + /* The GLX_ARB_create_context_no_error specs say: + * + * BadMatch is generated if the value of GLX_CONTEXT_OPENGL_NO_ERROR_ARB + * used to create <share_context> does not match the value of + * GLX_CONTEXT_OPENGL_NO_ERROR_ARB for the context being created. + */ + if (share_context && share_context->noError && !noError) { + return false; + } + + /* The GLX_ARB_create_context_no_error specs say: + * + * BadMatch is generated if the GLX_CONTEXT_OPENGL_NO_ERROR_ARB is TRUE at + * the same time as a debug or robustness context is specified. + * + */ + if (noError && ((flags & __DRI_CTX_FLAG_DEBUG) || + (flags & __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS))) { + return false; + } + + return true; +} + #endif /* GLX_DIRECT_RENDERING */ |