diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-26 14:42:54 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-28 10:25:13 +0200 |
commit | 20ff1f9db7fc5f5ed5298a8dce9f2dac431ca2dd (patch) | |
tree | 291eb5d49456789a5766925efb9316177f903225 /src/mesa/main/syncobj.c | |
parent | 78d3510f0c13a67a674e350e2b423b0b294a8b73 (diff) |
mesa: add client_wait_sync() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/syncobj.c')
-rw-r--r-- | src/mesa/main/syncobj.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index a3124e40056..ce9c99725ea 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -305,24 +305,11 @@ _mesa_FenceSync(GLenum condition, GLbitfield flags) } -GLenum GLAPIENTRY -_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) +static GLenum +client_wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj, + GLbitfield flags, GLuint64 timeout) { - GET_CURRENT_CONTEXT(ctx); - struct gl_sync_object *syncObj; GLenum ret; - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_WAIT_FAILED); - - if ((flags & ~GL_SYNC_FLUSH_COMMANDS_BIT) != 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glClientWaitSync(flags=0x%x)", flags); - return GL_WAIT_FAILED; - } - - syncObj = _mesa_get_and_ref_sync(ctx, sync, true); - if (!syncObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glClientWaitSync (not a valid sync object)"); - return GL_WAIT_FAILED; - } /* From the GL_ARB_sync spec: * @@ -349,6 +336,29 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) } +GLenum GLAPIENTRY +_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_sync_object *syncObj; + + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_WAIT_FAILED); + + if ((flags & ~GL_SYNC_FLUSH_COMMANDS_BIT) != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glClientWaitSync(flags=0x%x)", flags); + return GL_WAIT_FAILED; + } + + syncObj = _mesa_get_and_ref_sync(ctx, sync, true); + if (!syncObj) { + _mesa_error(ctx, GL_INVALID_VALUE, "glClientWaitSync (not a valid sync object)"); + return GL_WAIT_FAILED; + } + + return client_wait_sync(ctx, syncObj, flags, timeout); +} + + void GLAPIENTRY _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) { |