summaryrefslogtreecommitdiffstats
path: root/include/GL/internal
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-07-03 11:32:59 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-07-11 08:54:50 -0700
commita8724d85f8cb2f0fb73b9c6c1f268f9084c6d473 (patch)
tree875c9e37edfdbbf1746746e2b322f1597f54ace8 /include/GL/internal
parentde9ed5152533c87c21d27b71211a834b4c9767bc (diff)
glx/dri2: Add support for GLX_ARB_create_context_robustness
Add the infrastructure required for this extension. There is no xserver support and no driver support yet. Drivers can enable this be advertising DRI2 version 4 and accepting the __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in create context. Some additional Mesa infrastructure is needed before drivers can do this. The GL_ARB_robustness spec, which all Mesa drivers already advertise, requires: "If the behavior is LOSE_CONTEXT_ON_RESET_ARB, a graphics reset will result in the loss of all context state, requiring the recreation of all associated objects." It is necessary to land this infrastructure now so that the related infrastructure can land in the xserver. The xserver has very long release schedules, and the remaining Mesa parts should land long, long before the next xserver merge window opens. v2: Expose robustness as a DRI2 extension rather than bumping __DRI_DRI2_VERSION. v3: Add a comment explaining why dri2->base.version >= 3 is also required for GLX_ARB_create_context_robustness. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'include/GL/internal')
-rw-r--r--include/GL/internal/dri_interface.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index e37917eda99..29c9a116136 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -808,10 +808,28 @@ struct __DRIdri2LoaderExtensionRec {
#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
#define __DRI_CTX_ATTRIB_FLAGS 2
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
+
#define __DRI_CTX_FLAG_DEBUG 0x00000001
#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
+
+/**
+ * \name Context reset strategies.
+ */
+/*@{*/
+#define __DRI_CTX_RESET_NO_NOTIFICATION 0
+#define __DRI_CTX_RESET_LOSE_CONTEXT 1
+/*@}*/
+
+/**
* \name Reasons that __DRIdri2Extension::createContextAttribs might fail
*/
/*@{*/
@@ -1000,4 +1018,21 @@ struct __DRI2configQueryExtensionRec {
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
};
+
+/**
+ * Robust context driver extension.
+ *
+ * Existence of this extension means the driver can accept the
+ * \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
+ * \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
+ * \c __DRIdri2ExtensionRec::createContextAttribs.
+ */
+#define __DRI2_ROBUSTNESS "DRI_Robustness"
+#define __DRI2_ROBUSTNESS_VERSION 1
+
+typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
+struct __DRIrobustnessExtensionRec {
+ __DRIextension base;
+};
+
#endif