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

Jordan Justen jordan.l.justen at intel.com
Fri Oct 30 00:31:39 PDT 2015


I sent a patch on Oct 14 for this:

  "main: Match DispatchCompute* API validation from main specification"

http://patchwork.freedesktop.org/patch/61881/

You might want monitor my cs git branch for related patches to help
with the OpenGLES 3.1 CTS compute shader tests.

-Jordan

On 2015-10-29 07:23:33, Marta Lofstedt wrote:
> 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
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list