summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2021-10-04 17:46:46 -0400
committerMarge Bot <emma+marge@anholt.net>2022-02-04 18:36:24 +0000
commit3e3d75d16abb00c0aacff3fc058d65d4ad5c1a29 (patch)
tree7b04f2d69424825b48deed65abb1bb29956e7d95 /include
parent5e994c5d983986788c18f2b87a3ee80e4c3f5936 (diff)
dri: Epoch how no-error context creation works
The bug here is that the DRI context "flags" are intended to alias the GLX context flag values, and they don't, DRI's no-error flag is GLX's reset-isolation flag. GLX (and EGL!) treat no-error as a context attribute, and reset isolation predates Mesa's no-error implementation by several years. The GL_KHR_no_error spec does describe it as a "context flag", though, so maybe that's why we do it as a (DRI) context flag. In order to unalias these we need a new contract with the loader. We remove the old __DRI_NO_ERROR extension, and add a new __DRI_RENDERER_HAS_CONTEXT_NO_ERROR value to query. Loaders can key on that to know to pass no-error-ness through as a context attribute, matching the GLX/EGL calling convention. We go ahead and define __DRI_CTX_FLAG_RESET_ISOLATION as well, and update the drivers to refuse it since we don't support it yet. This means mismatched drivers/loaders will not be able to create no-error contexts. Too bad. If you want performance that badly you can build both things at once. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
Diffstat (limited to 'include')
-rw-r--r--include/GL/internal/dri_interface.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 10ce61e8eda..443f6496b0f 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1063,16 +1063,22 @@ struct __DRIdri2LoaderExtensionRec {
#define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
+/* These must alias the GLX/EGL values. */
#define __DRI_CTX_ATTRIB_FLAGS 2
#define __DRI_CTX_FLAG_DEBUG 0x00000001
#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
-#define __DRI_CTX_FLAG_NO_ERROR 0x00000008
+#define __DRI_CTX_FLAG_NO_ERROR 0x00000008 /* Deprecated, do not use */
+/* Not yet implemented but placed here to reserve the alias with GLX */
+#define __DRI_CTX_FLAG_RESET_ISOLATION 0x00000008
#define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
#define __DRI_CTX_RESET_NO_NOTIFICATION 0
#define __DRI_CTX_RESET_LOSE_CONTEXT 1
+/**
+ * \name Context priority levels.
+ */
#define __DRI_CTX_ATTRIB_PRIORITY 4
#define __DRI_CTX_PRIORITY_LOW 0
#define __DRI_CTX_PRIORITY_MEDIUM 1
@@ -1082,7 +1088,9 @@ struct __DRIdri2LoaderExtensionRec {
#define __DRI_CTX_RELEASE_BEHAVIOR_NONE 0
#define __DRI_CTX_RELEASE_BEHAVIOR_FLUSH 1
-#define __DRI_CTX_NUM_ATTRIBS 6
+#define __DRI_CTX_ATTRIB_NO_ERROR 6
+
+#define __DRI_CTX_NUM_ATTRIBS 7
/**
* \name Reasons that __DRIdri2Extension::createContextAttribs might fail
@@ -1758,10 +1766,13 @@ struct __DRIrobustnessExtensionRec {
};
/**
- * No-error context driver extension.
+ * No-error context driver extension (deprecated).
*
* Existence of this extension means the driver can accept the
* __DRI_CTX_FLAG_NO_ERROR flag.
+ *
+ * This extension is deprecated, and modern loaders will not use it. Please
+ * use __DRI2_RENDERER_HAS_NO_ERROR_CONTEXT instead.
*/
#define __DRI2_NO_ERROR "DRI_NoError"
#define __DRI2_NO_ERROR_VERSION 1
@@ -1868,6 +1879,7 @@ typedef struct __DRIDriverVtableExtensionRec {
#define __DRI2_RENDERER_HAS_PROTECTED_CONTENT 0x000e
#define __DRI2_RENDERER_PREFER_BACK_BUFFER_REUSE 0x000f
+#define __DRI2_RENDERER_HAS_NO_ERROR_CONTEXT 0x0010
typedef struct __DRI2rendererQueryExtensionRec __DRI2rendererQueryExtension;
struct __DRI2rendererQueryExtensionRec {