mesa: add wait_sync() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Jul 2017 09:09:13 +0000 (11:09 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:39 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/syncobj.c

index cb6f8868bd29c9391697ce21cdc7ea946b9eb678..915b7009f78ac6d1f270541ca303485c5d7a6167 100644 (file)
@@ -381,6 +381,15 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
 }
 
 
+static void
+wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj,
+          GLbitfield flags, GLuint64 timeout)
+{
+   ctx->Driver.ServerWaitSync(ctx, syncObj, flags, timeout);
+   _mesa_unref_sync_object(ctx, syncObj, 1);
+}
+
+
 void GLAPIENTRY
 _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
 {
@@ -404,8 +413,7 @@ _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
       return;
    }
 
-   ctx->Driver.ServerWaitSync(ctx, syncObj, flags, timeout);
-   _mesa_unref_sync_object(ctx, syncObj, 1);
+   wait_sync(ctx, syncObj, flags, timeout);
 }