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@linux.intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
{
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;