diff options
author | Marek Olšák <[email protected]> | 2020-01-22 22:38:09 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-02-14 18:16:27 -0500 |
commit | fd6636ebc06d55b59851701c436b8b97f50fd7f4 (patch) | |
tree | 9227ae4b2461b4e07f72c71646ed4f0d4b21543b /src/mesa/main/varray.c | |
parent | 1d933728024f907236ffe95da5f5f0eabf6052c7 (diff) |
st/mesa: simplify determination whether a draw needs min/max index
Reviewed-by: Mathias Fröhlich <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 7ef0de7734a..2f6aefc9ccb 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -174,6 +174,11 @@ _mesa_vertex_attrib_binding(struct gl_context *ctx, else vao->VertexAttribBufferMask &= ~array_bit; + if (vao->BufferBinding[bindingIndex].InstanceDivisor) + vao->NonZeroDivisorMask |= array_bit; + else + vao->NonZeroDivisorMask &= ~array_bit; + vao->BufferBinding[array->BufferBindingIndex]._BoundArrays &= ~array_bit; vao->BufferBinding[bindingIndex]._BoundArrays |= array_bit; @@ -250,6 +255,12 @@ vertex_binding_divisor(struct gl_context *ctx, if (binding->InstanceDivisor != divisor) { binding->InstanceDivisor = divisor; + + if (divisor) + vao->NonZeroDivisorMask |= binding->_BoundArrays; + else + vao->NonZeroDivisorMask &= ~binding->_BoundArrays; + vao->NewArrays |= vao->Enabled & binding->_BoundArrays; } } |