On 10/20/2015 08:54 PM, Marek Olšák wrote:
On Tue, Oct 20, 2015 at 4:19 PM, Marta Lofstedt
<marta.lofst...@linux.intel.com> wrote:
From: Marta Lofstedt <marta.lofst...@intel.com>

OpenGL ES 3.1 spec. section 10.5:
"An INVALID_OPERATION error is generated if zero is bound
to VERTEX_ARRAY_BINDING, DRAW_INDIRECT_BUFFER or to
any enabled vertex array."

Signed-off-by: Marta Lofstedt <marta.lofst...@linux.intel.com>
---
  src/mesa/main/api_validate.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index c5628f5..7062cbd 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -711,6 +711,20 @@ valid_draw_indirect(struct gl_context *ctx,
        return GL_FALSE;
     }

+   /*
+    * OpenGL ES 3.1 spec. section 10.5:
+    * "An INVALID_OPERATION error is generated if zero is bound to
+    * VERTEX_ARRAY_BINDING, DRAW_INDIRECT_BUFFER or to any enabled
+    * vertex array."
+    * OpenGL 4.5 spec. section 10.4:
+    * "An INVALID_OPERATION error is generated if  zero is bound to
+    * DRAW_INDIRECT_BUFFER, or if  no element array buffer is bound"
+    */
+   if (!_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "%s(No VBO is bound)", name);
+   }
NAK.

VERTEX_ARRAY_BINDING is a VAO. Array.ArrayBufferObj is from glBindBuffer.

This check is valid, it is not against VERTEX_ARRAY_BINDING. Note "any enabled vertex array", we hit this weird situation when client has a VAO bound and has enabled vertex attrib array but has not bound any VBO to it.

Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>

Marek
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


// Tapani

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to