diff options
author | Mathias Fröhlich <[email protected]> | 2018-02-04 17:13:06 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-02-09 04:26:23 +0100 |
commit | 77cb2fc0bd8f57b646ef5ab674c1f76d873a22ae (patch) | |
tree | ba370ba824495a6b1a218c428c850ea0825b7b64 /src/mesa/main/varray.c | |
parent | 437cae411e7664e01d9c1c280317274b3ffc0734 (diff) |
mesa: Only update enabled VAO gl_vertex_array entries.
Instead of updating all modified gl_vertex_array_object::_VertexArray
entries just update those that are modified and enabled.
Also release buffer object from the _VertexArray that belong
to disabled attributes.
v2: Also set Ptr and Size to zero.
Signed-off-by: Mathias Fröhlich <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 4dfc3546a8c..d55f74e968f 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -178,7 +178,7 @@ vertex_attrib_binding(struct gl_context *ctx, array->BufferBindingIndex = bindingIndex; - vao->NewArrays |= array_bit; + vao->NewArrays |= vao->_Enabled & array_bit; } } @@ -213,7 +213,7 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx, else vao->VertexAttribBufferMask |= binding->_BoundArrays; - vao->NewArrays |= binding->_BoundArrays; + vao->NewArrays |= vao->_Enabled & binding->_BoundArrays; } } @@ -234,7 +234,7 @@ vertex_binding_divisor(struct gl_context *ctx, if (binding->InstanceDivisor != divisor) { FLUSH_VERTICES(ctx, _NEW_ARRAY); binding->InstanceDivisor = divisor; - vao->NewArrays |= binding->_BoundArrays; + vao->NewArrays |= vao->_Enabled & binding->_BoundArrays; } } @@ -344,7 +344,7 @@ _mesa_update_array_format(struct gl_context *ctx, array->RelativeOffset = relativeOffset; array->_ElementSize = elementSize; - vao->NewArrays |= VERT_BIT(attrib); + vao->NewArrays |= vao->_Enabled & VERT_BIT(attrib); ctx->NewState |= _NEW_ARRAY; } |