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

Jordan Justen jordan.l.justen at intel.com
Tue Dec 4 15:55:03 PST 2012


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;
    }
 
-- 
1.7.10.4



More information about the mesa-dev mailing list