We only need to update it if something changes. Also
_mesa_bind_vertex_buffer() will update the mask when binding to a
NULL or default buffer so no need to do that update here.
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
{
struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
- if (!_mesa_is_bufferobj(vao->BufferBinding[bindingIndex].BufferObj))
- vao->VertexAttribBufferMask &= ~VERT_BIT(attribIndex);
- else
- vao->VertexAttribBufferMask |= VERT_BIT(attribIndex);
-
if (array->BufferBindingIndex != bindingIndex) {
const GLbitfield64 array_bit = VERT_BIT(attribIndex);
+ if (_mesa_is_bufferobj(vao->BufferBinding[bindingIndex].BufferObj))
+ vao->VertexAttribBufferMask |= array_bit;
+
FLUSH_VERTICES(ctx, _NEW_ARRAY);
vao->BufferBinding[array->BufferBindingIndex]._BoundArrays &= ~array_bit;