diff options
author | Grigori Goronzy <[email protected]> | 2017-06-29 03:24:15 +0200 |
---|---|---|
committer | Grigori Goronzy <[email protected]> | 2017-07-14 21:20:31 +0200 |
commit | 7299e82fa444c86f4c5e22593424715454182e9a (patch) | |
tree | ea8359383822ac6b807f3dd4bf7afaaaba9c081b /src/mesa/drivers/dri/common | |
parent | cfbf60b0c21b105ad162a0a451cd2f65124efedc (diff) |
dri: Add KHR_no_error DRI extension
This basic extension allows usage of the __DRI_CTX_FLAG_NO_ERROR flag.
This includes support code for classic Mesa drivers to switch on the
no-error mode if the flag is set.
v2: Move to common DRI code.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.h | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index f6df48802f3..bfae0209d18 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -403,7 +403,8 @@ driCreateContextAttribs(__DRIscreen *screen, int api, if (mesa_api != API_OPENGL_COMPAT && mesa_api != API_OPENGL_CORE && (flags & ~(__DRI_CTX_FLAG_DEBUG | - __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS))) { + __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS | + __DRI_CTX_FLAG_NO_ERROR))) { *error = __DRI_CTX_ERROR_BAD_FLAG; return NULL; } @@ -425,7 +426,8 @@ driCreateContextAttribs(__DRIscreen *screen, int api, const uint32_t allowed_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); if (flags & ~allowed_flags) { *error = __DRI_CTX_ERROR_UNKNOWN_FLAG; return NULL; @@ -467,6 +469,8 @@ driContextSetFlags(struct gl_context *ctx, uint32_t flags) _mesa_set_debug_state_int(ctx, GL_DEBUG_OUTPUT, GL_TRUE); ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT; } + if ((flags & __DRI_CTX_FLAG_NO_ERROR) != 0) + ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR; } static __DRIcontext * @@ -935,3 +939,7 @@ const __DRIcopySubBufferExtension driCopySubBufferExtension = { .copySubBuffer = driCopySubBuffer, }; + +const __DRInoErrorExtension dri2NoErrorExtension = { + .base = { __DRI2_NO_ERROR, 1 }, +}; diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 8fcd6322d04..3e1ce624c7b 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -293,4 +293,6 @@ driContextSetFlags(struct gl_context *ctx, uint32_t flags); extern const __DRIimageDriverExtension driImageDriverExtension; +extern const __DRInoErrorExtension dri2NoErrorExtension; + #endif /* _DRI_UTIL_H_ */ |