From: Marta Lofstedt Date: Mon, 26 Oct 2015 09:58:37 +0000 (+0100) Subject: mesa: Draw indirect is not allowed if the default VAO is bound. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16c49da63a72aa4b1dce5c90397ee4af2f6a8f9d;p=mesa.git mesa: Draw indirect is not allowed if the default VAO is bound. 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 Reviewed-by: Tapani Pälli --- diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index e936d62d488..06efe02e445 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;