Mesa (master): mesa: Draw Indirect return wrong error code on unalinged

Marta Löfstedt marta at kemper.freedesktop.org
Tue Oct 27 07:47:07 UTC 2015


Module: Mesa
Branch: master
Commit: 2c91e086563541271668f9ea6ca58689c0c97d44
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c91e086563541271668f9ea6ca58689c0c97d44

Author: Marta Lofstedt <marta.lofstedt at intel.com>
Date:   Mon Oct 26 11:22:27 2015 +0100

mesa: Draw Indirect return wrong error code on unalinged

>From OpenGL 4.4 specification, section 10.4 and
Open GL Es 3.1 section 10.5:
"An INVALID_VALUE error is generated if indirect is not a multiple
of the size, in basic machine units, of uint."

However, the current code follow the ARB_draw_indirect:
https://www.opengl.org/registry/specs/ARB/draw_indirect.txt
"INVALID_OPERATION is generated by DrawArraysIndirect and
DrawElementsIndirect if commands source data beyond the end
of a buffer object or if <indirect> is not word aligned."

V2: After discussions on the list, it was suggested to
only keep the INVALID_VALUE error.

Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/mesa/main/api_validate.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index a46c194..e4cfc9b 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -702,12 +702,14 @@ valid_draw_indirect(struct gl_context *ctx,
       return GL_FALSE;
 
 
-   /* From the ARB_draw_indirect specification:
-    * "An INVALID_OPERATION error is generated [...] if <indirect> is no
-    *  word aligned."
+   /* From OpenGL version 4.4. section 10.5
+    * and OpenGL ES 3.1, section 10.6:
+    *
+    *      "An INVALID_VALUE error is generated if indirect is not a
+    *       multiple of the size, in basic machine units, of uint."
     */
    if ((GLsizeiptr)indirect & (sizeof(GLuint) - 1)) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
+      _mesa_error(ctx, GL_INVALID_VALUE,
                   "%s(indirect is not aligned)", name);
       return GL_FALSE;
    }




More information about the mesa-commit mailing list