[Mesa-dev] [PATCH v2] mesa: Draw indirect is not allowed if the default VAO is bound.

Tapani Pälli tapani.palli at intel.com
Tue Oct 27 03:57:29 PDT 2015


Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

On 10/26/2015 11:58 AM, Marta Lofstedt wrote:
> From: Marta Lofstedt <marta.lofstedt at intel.com>
>
>  From OpenGL ES 3.1 specification, section 10.5:
> "DrawArraysIndirect requires that all data sourced for the
> command, including the DrawArraysIndirectCommand
> structure,  be in buffer objects,  and may not be called when
> the default vertex array object is bound."
>
> Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
> ---
>   src/mesa/main/api_validate.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index a46c194..40a2f43 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -698,6 +698,18 @@ valid_draw_indirect(struct gl_context *ctx,
>   {
>      const GLsizeiptr end = (GLsizeiptr)indirect + size;
>
> +   /* OpenGL ES 3.1 spec. section 10.5:
> +    *
> +    *      "DrawArraysIndirect requires that all data sourced for the
> +    *      command, including the DrawArraysIndirectCommand
> +    *      structure,  be in buffer objects,  and may not be called when
> +    *      the default vertex array object is bound."
> +    */
> +   if (ctx->Array.VAO == ctx->Array.DefaultVAO) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION, "(no VAO bound)");
> +      return GL_FALSE;
> +   }
> +
>      if (!_mesa_valid_prim_mode(ctx, mode, name))
>         return GL_FALSE;
>
>


More information about the mesa-dev mailing list