[Mesa-dev] [PATCH] mesa: DispatchComputeIndirect should return INVALID_VALUE on unaligned

Marta Lofstedt marta.lofstedt at linux.intel.com
Thu Oct 29 07:23:33 PDT 2015


From: Marta Lofstedt <marta.lofstedt at intel.com>

>From the ARB_compute_shader specification:

"An INVALID_OPERATION error is generated [...] if <indirect> is
less than zero or not a multiple of the size, in basic machine
units, of uint."

However, OpenGL ES 3.1 specification, section 17 and OpenGL 4.5
specification, section 19, has the updated definition:

"An INVALID_VALUE error is generated if indirect is negative or
is not a multiple of the size, in basic machine units, of uint."

Mesa should use the updated version.
---
 src/mesa/main/api_validate.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 06efe02..9ee8252 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -960,14 +960,15 @@ valid_dispatch_indirect(struct gl_context *ctx,
    if (!check_valid_to_compute(ctx, name))
       return GL_FALSE;
 
-   /* From the ARB_compute_shader specification:
+   /* From the OpenGL ES 3.1 specification, section 17 and the
+    * OpenGL 4.5 specification, section 19:
     *
-    * "An INVALID_OPERATION error is generated [...] if <indirect> is less
-    *  than zero or not a multiple of the size, in basic machine units, of
-    *  uint."
+    *       "An INVALID_VALUE error is generated if indirect is negative
+    *        or is not a multiple of the size, in basic machine units,
+    *        of uint."
     */
    if ((GLintptr)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;
    }
-- 
2.1.4



More information about the mesa-dev mailing list