array->BufferBindingIndex = bindingIndex;
- vao->NewArrays |= array_bit;
+ vao->NewArrays |= vao->_Enabled & array_bit;
}
}
else
vao->VertexAttribBufferMask |= binding->_BoundArrays;
- vao->NewArrays |= binding->_BoundArrays;
+ vao->NewArrays |= vao->_Enabled & binding->_BoundArrays;
}
}
if (binding->InstanceDivisor != divisor) {
FLUSH_VERTICES(ctx, _NEW_ARRAY);
binding->InstanceDivisor = divisor;
- vao->NewArrays |= binding->_BoundArrays;
+ vao->NewArrays |= vao->_Enabled & binding->_BoundArrays;
}
}
array->RelativeOffset = relativeOffset;
array->_ElementSize = elementSize;
- vao->NewArrays |= VERT_BIT(attrib);
+ vao->NewArrays |= vao->_Enabled & VERT_BIT(attrib);
ctx->NewState |= _NEW_ARRAY;
}
const struct gl_array_attributes *attribs,
const struct gl_vertex_buffer_binding *binding)
{
- dst->Size = attribs->Size;
- dst->Type = attribs->Type;
- dst->Format = attribs->Format;
- dst->StrideB = binding->Stride;
- dst->Ptr = _mesa_vertex_attrib_address(attribs, binding);
- dst->Normalized = attribs->Normalized;
- dst->Integer = attribs->Integer;
- dst->Doubles = attribs->Doubles;
- dst->InstanceDivisor = binding->InstanceDivisor;
- dst->_ElementSize = attribs->_ElementSize;
- _mesa_reference_buffer_object(ctx, &dst->BufferObj, binding->BufferObj);
+ if (attribs->Enabled) {
+ dst->Size = attribs->Size;
+ dst->Type = attribs->Type;
+ dst->Format = attribs->Format;
+ dst->StrideB = binding->Stride;
+ dst->Ptr = _mesa_vertex_attrib_address(attribs, binding);
+ dst->Normalized = attribs->Normalized;
+ dst->Integer = attribs->Integer;
+ dst->Doubles = attribs->Doubles;
+ dst->InstanceDivisor = binding->InstanceDivisor;
+ dst->_ElementSize = attribs->_ElementSize;
+ _mesa_reference_buffer_object(ctx, &dst->BufferObj, binding->BufferObj);
+ } else {
+ /* Disabled arrays shall not be consumed */
+ dst->Size = 0;
+ dst->Ptr = NULL;
+ _mesa_reference_buffer_object(ctx, &dst->BufferObj, NULL);
+ }
}