[Mesa-dev] [PATCH 2/3] main/syncobj: return GL_INVALID_VALUE for invalid sync objects

Brian Paul brianp at vmware.com
Wed Dec 5 07:33:52 PST 2012


On 12/04/2012 04:55 PM, Jordan Justen wrote:
> Note: The GL/GLES3 web man pages don't seem to properly
> document glWaitSync's error when the sync object is invalid.
>
> Signed-off-by: Jordan Justen<jordan.l.justen at intel.com>
> ---
>   src/mesa/main/syncobj.c |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
> index 745e982..a2d3137 100644
> --- a/src/mesa/main/syncobj.c
> +++ b/src/mesa/main/syncobj.c
> @@ -235,7 +235,7 @@ _mesa_DeleteSync(GLsync sync)
>      }
>
>      if (!_mesa_validate_sync(syncObj)) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteSync");
> +      _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSync (not a valid sync object)");
>         return;
>      }
>
> @@ -303,7 +303,7 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
>      ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_WAIT_FAILED);
>
>      if (!_mesa_validate_sync(syncObj)) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION, "glClientWaitSync");
> +      _mesa_error(ctx, GL_INVALID_VALUE, "glClientWaitSync (not a valid sync object)");
>         return GL_WAIT_FAILED;
>      }
>
> @@ -347,7 +347,7 @@ _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
>      ASSERT_OUTSIDE_BEGIN_END(ctx);
>
>      if (!_mesa_validate_sync(syncObj)) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION, "glWaitSync");
> +      _mesa_error(ctx, GL_INVALID_VALUE, "glWaitSync (not a valid sync object)");
>         return;
>      }
>
> @@ -376,7 +376,7 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
>      ASSERT_OUTSIDE_BEGIN_END(ctx);
>
>      if (!_mesa_validate_sync(syncObj)) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION, "glGetSynciv");
> +      _mesa_error(ctx, GL_INVALID_VALUE, "glGetSynciv (not a valid sync object)");
>         return;
>      }
>

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list