return GL_FALSE;
}
+ /* From 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."
+ *
+ * Here we check that for each enabled vertex array we have a vertex
+ * buffer bound.
+ */
+ if (_mesa_is_gles31(ctx) &&
+ ctx->Array.VAO->_Enabled != ctx->Array.VAO->VertexAttribBufferMask) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(No VBO bound)", name);
+ return GL_FALSE;
+ }
+
if (!_mesa_valid_prim_mode(ctx, mode, name))
return GL_FALSE;
/** Vertex buffer bindings */
struct gl_vertex_buffer_binding VertexBinding[VERT_ATTRIB_MAX];
+ /** Mask indicating which vertex arrays have vertex buffer associated. */
+ GLbitfield64 VertexAttribBufferMask;
+
/** Mask of VERT_BIT_* values indicating which arrays are enabled */
GLbitfield64 _Enabled;
{
struct gl_vertex_attrib_array *array = &vao->VertexAttrib[attribIndex];
+ if (!_mesa_is_bufferobj(vao->VertexBinding[bindingIndex].BufferObj))
+ vao->VertexAttribBufferMask &= ~VERT_BIT(attribIndex);
+ else
+ vao->VertexAttribBufferMask |= VERT_BIT(attribIndex);
+
if (array->VertexBinding != bindingIndex) {
const GLbitfield64 array_bit = VERT_BIT(attribIndex);
binding->Offset = offset;
binding->Stride = stride;
+ if (!_mesa_is_bufferobj(vbo))
+ vao->VertexAttribBufferMask &= ~binding->_BoundArrays;
+ else
+ vao->VertexAttribBufferMask |= binding->_BoundArrays;
+
vao->NewArrays |= binding->_BoundArrays;
}
}