Commit 007d812a authored by Adam Jackson's avatar Adam Jackson 🥃 Committed by Adam Jackson

glx: Fix GLX_CONTEXT_RELEASE_BEHAVIOR_ARB handling

None of this was getting compiled because we hadn't defined the macro
(and aren't getting them from <GL/glxext.h> because reasons). Fix that.

Fixes: xorg/xserver#684
parent a2302de6
......@@ -88,9 +88,7 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
int minor_version = 0;
uint32_t flags = 0;
uint32_t render_type = GLX_RGBA_TYPE;
#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
uint32_t flush = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB;
#endif
__GLXcontext *ctx = NULL;
__GLXcontext *shareCtx = NULL;
__GLXscreen *glxScreen;
......@@ -201,14 +199,12 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
break;
#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
case GLX_CONTEXT_RELEASE_BEHAVIOR_ARB:
flush = attribs[2 * i + 1];
if (flush != GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
&& flush != GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB)
return BadValue;
break;
#endif
case GLX_SCREEN:
/* Only valid for GLX_EXT_no_config_context */
......@@ -348,9 +344,7 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
ctx->isDirect = req->isDirect;
ctx->renderMode = GL_RENDER;
ctx->resetNotificationStrategy = reset;
#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
ctx->releaseBehavior = flush;
#endif
/* Add the new context to the various global tables of GLX contexts.
*/
......
......@@ -50,6 +50,11 @@
#ifndef GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
#endif
#ifndef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
#endif
extern void __glXFlushContextCache(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment