summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-02-20 11:03:45 -0500
committerAdam Jackson <ajax@redhat.com>2018-02-26 10:18:58 -0500
commita63ab81f6be7ad46b7e2d98a50aef4da5e664847 (patch)
tree19766ccdc8798b68f73e723197dcd45d11c5d2a1 /glx
parent701f3a206d6f71c4754f457e95e2b954cf0b80c7 (diff)
downloadxserver-a63ab81f6be7ad46b7e2d98a50aef4da5e664847.tar.gz
glx: Enable GLX_ARB_create_context_no_error (v2)
This is mostly for the client library's convenience, if this extension is listed then it can know the attribute won't be rejected. Note that we don't honor this attribute for indirect contexts. That's fine, we don't want to introduce undefined behavior into a potentially privileged process. v2: Remember to ignore the attribute (Eric Anholt) Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/createcontext.c4
-rw-r--r--glx/extension_string.c1
-rw-r--r--glx/extension_string.h1
-rw-r--r--glx/glxdri2.c7
-rw-r--r--glx/glxdriswrast.c2
-rw-r--r--glx/glxserver.h4
6 files changed, 18 insertions, 1 deletions
diff --git a/glx/createcontext.c b/glx/createcontext.c
index 00c23fcdd..7d09c3a1c 100644
--- a/glx/createcontext.c
+++ b/glx/createcontext.c
@@ -218,6 +218,10 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
return BadValue;
break;
+ case GLX_CONTEXT_OPENGL_NO_ERROR_ARB:
+ /* ignore */
+ break;
+
default:
if (!req->isDirect)
return BadValue;
diff --git a/glx/extension_string.c b/glx/extension_string.c
index 102f9dd42..354ce06f7 100644
--- a/glx/extension_string.c
+++ b/glx/extension_string.c
@@ -74,6 +74,7 @@ static const struct extension_info known_glx_extensions[] = {
/* *INDENT-OFF* */
{ GLX(ARB_context_flush_control), VER(0,0), N, },
{ GLX(ARB_create_context), VER(0,0), N, },
+ { GLX(ARB_create_context_no_error), VER(0,0), N, },
{ GLX(ARB_create_context_profile), VER(0,0), N, },
{ GLX(ARB_create_context_robustness), VER(0,0), N, },
{ GLX(ARB_fbconfig_float), VER(0,0), N, },
diff --git a/glx/extension_string.h b/glx/extension_string.h
index f049f5840..eab385a3c 100644
--- a/glx/extension_string.h
+++ b/glx/extension_string.h
@@ -38,6 +38,7 @@ enum {
/* GLX_ARB_get_proc_address is implemented on the client. */
ARB_context_flush_control_bit = 0,
ARB_create_context_bit,
+ ARB_create_context_no_error_bit,
ARB_create_context_profile_bit,
ARB_create_context_robustness_bit,
ARB_fbconfig_float_bit,
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 6887e199c..25ee9acf9 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -42,10 +42,10 @@
#include <xf86.h>
#include <dri2.h>
+#include <GL/glxtokens.h>
#include "glxserver.h"
#include "glxutil.h"
#include "glxdricommon.h"
-#include <GL/glxtokens.h>
#include "extension_string.h"
@@ -402,6 +402,9 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
return FALSE;
}
break;
+ case GLX_CONTEXT_OPENGL_NO_ERROR_ARB:
+ /* ignore */
+ break;
default:
/* If an unknown attribute is received, fail.
*/
@@ -833,6 +836,8 @@ initializeExtensions(__GLXscreen * screen)
__glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context");
__glXEnableExtension(screen->glx_enable_bits,
+ "GLX_ARB_create_context_no_error");
+ __glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context_profile");
__glXEnableExtension(screen->glx_enable_bits,
"GLX_EXT_create_context_es_profile");
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index caad9a1fe..2858312de 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -357,6 +357,8 @@ initializeExtensions(__GLXscreen * screen)
__glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context");
__glXEnableExtension(screen->glx_enable_bits,
+ "GLX_ARB_create_context_no_error");
+ __glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context_profile");
__glXEnableExtension(screen->glx_enable_bits,
"GLX_EXT_create_context_es_profile");
diff --git a/glx/glxserver.h b/glx/glxserver.h
index 60bdeb00d..79f4944d0 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -50,6 +50,10 @@
#include <GL/glext.h>
#include <GL/glxproto.h>
+#ifndef GLX_CONTEXT_OPENGL_NO_ERROR_ARB
+#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3
+#endif
+
/*
** GLX resources.
*/