From: Samuel Pitoiset Date: Tue, 18 Jul 2017 09:09:13 +0000 (+0200) Subject: mesa: add wait_sync() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6f81a1df833c2adf1cec735a197fe54d21d435a;p=mesa.git mesa: add wait_sync() helper Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- 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); }