summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorMarta Lofstedt <marta.lofstedt@intel.com>2015-10-26 10:58:37 +0100
committerMarta Lofstedt <marta.lofstedt@linux.intel.com>2015-10-27 12:16:23 +0100
commit16c49da63a72aa4b1dce5c90397ee4af2f6a8f9d (patch)
tree0626d17c3b0ed253d5966eb0d366421a1bdb6de2 /src/mesa/main/api_validate.c
parent93eb4f9287576e346838e7b38fec9b42518605f6 (diff)
downloadexternal_mesa3d-16c49da63a72aa4b1dce5c90397ee4af2f6a8f9d.zip
external_mesa3d-16c49da63a72aa4b1dce5c90397ee4af2f6a8f9d.tar.gz
external_mesa3d-16c49da63a72aa4b1dce5c90397ee4af2f6a8f9d.tar.bz2
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 <marta.lofstedt@linux.intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index e936d62..06efe02 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;