[Mesa-dev] [PATCH xserver 2/3] glx: Allow attributes from GLX_ARB_context_flush_control

Neil Roberts neil at linux.intel.com
Wed Oct 1 12:06:56 PDT 2014


The commit for adding the reset notification extension (90aa2486e) has
a note saying that we can assume that if the underlying provider
doesn't support the extension then it will generate BadMatch for these
attributes. This patch takes the same approach.
---
 glx/createcontext.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/glx/createcontext.c b/glx/createcontext.c
index cbeddec..be69ac6 100644
--- a/glx/createcontext.c
+++ b/glx/createcontext.c
@@ -100,6 +100,13 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
      */
     int reset = GLX_NO_RESET_NOTIFICATION_ARB;
 
+    /* The GLX_ARB_context_flush_control spec says:
+     *
+     *     "The default value of GLX_CONTEXT_RELEASE_BEHAVIOR_ARB is
+     *     GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB".
+     */
+    int release_behavior = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB;
+
     /* The GLX_ARB_create_context_profile spec says:
      *
      *     "The default value for GLX_CONTEXT_PROFILE_MASK_ARB is
@@ -194,6 +201,14 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
 
             break;
 
+        case GLX_CONTEXT_RELEASE_BEHAVIOR_ARB:
+            release_behavior = attribs[2 * i + 1];
+            if (release_behavior != GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
+                && release_behavior != GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB)
+                return BadValue;
+
+            break;
+
         default:
             return BadValue;
         }
-- 
1.9.3



More information about the mesa-dev mailing list