From c6f81a1df833c2adf1cec735a197fe54d21d435a Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 18 Jul 2017 11:09:13 +0200 Subject: [PATCH] mesa: add wait_sync() helper Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- src/mesa/main/syncobj.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index cb6f8868bd2..915b7009f78 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -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); } -- 2.30.2