Re: [PATCH xserver 2/2] glx: Enable GLX_ARB_create_context_no_error

2017-12-14 Thread Eric Anholt
Adam Jackson  writes:

> 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 _do_ anything with this attribute, meaning indirect contexts will
> not be no-error. That's fine, we don't want to introduce undefined
> behavior into a potentially privileged process anyway.

I agree, but don't we need to accept GLX_CONTEXT_OPENGL_NO_ERROR_ARB and
drop it on the floor instead of falling through to createcontext.c's:

default:
if (!req->isDirect)
return BadValue;
break;


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 2/2] glx: Enable GLX_ARB_create_context_no_error

2017-12-13 Thread Adam Jackson
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 _do_ anything with this attribute, meaning indirect contexts will
not be no-error. That's fine, we don't want to introduce undefined
behavior into a potentially privileged process anyway.

Signed-off-by: Adam Jackson 
---
 glx/extension_string.c | 1 +
 glx/extension_string.h | 1 +
 glx/glxdri2.c  | 2 ++
 glx/glxdriswrast.c | 2 ++
 4 files changed, 6 insertions(+)

diff --git a/glx/extension_string.c b/glx/extension_string.c
index 102f9dd42b..354ce06f71 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 f049f58400..eab385a3c7 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 28d5a3a9c0..52c786977d 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -832,6 +832,8 @@ initializeExtensions(__GLXscreen * screen)
 if (dri->dri2->base.version >= 3) {
 __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,
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index caad9a1fe7..2858312de7 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -356,6 +356,8 @@ initializeExtensions(__GLXscreen * screen)
 if (dri->swrast->base.version >= 3) {
 __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,
-- 
2.14.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel