diff options
author | Tapani Pälli <[email protected]> | 2015-11-13 11:13:05 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2015-11-26 08:01:31 +0200 |
commit | c2e146f4879b806e7178b8145645268c1ce0b4cd (patch) | |
tree | 048342c20d14b19ce55f648d9b1327ed5dd657b8 /src/mesa/main/varray.c | |
parent | 22d2dda03be32d23bc8e9f5823a4f2469737ddbe (diff) |
mesa: error out in indirect draw when vertex bindings mismatch
Patch adds additional mask for tracking which vertex arrays have
associated vertex buffer binding set. This array can be directly
compared to which vertex arrays are enabled and should match when
drawing.
Fixes following CTS tests:
ES31-CTS.draw_indirect.negative-noVBO-arrays
ES31-CTS.draw_indirect.negative-noVBO-elements
v2: update mask in vertex_array_attrib_binding
v3: rename mask and make it track _BoundArrays which matches what
was actually originally wanted (Fredrik Höglund)
v4: code cleanup, check for GLES 3.1 (Fredrik Höglund)
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Fredrik Höglund <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 8836c182a41..58f376b8af3 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -135,6 +135,11 @@ vertex_attrib_binding(struct gl_context *ctx, { 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); @@ -174,6 +179,11 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx, binding->Offset = offset; binding->Stride = stride; + if (!_mesa_is_bufferobj(vbo)) + vao->VertexAttribBufferMask &= ~binding->_BoundArrays; + else + vao->VertexAttribBufferMask |= binding->_BoundArrays; + vao->NewArrays |= binding->_BoundArrays; } } |