summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-22 22:38:09 -0500
committerMarek Olšák <[email protected]>2020-02-14 18:16:27 -0500
commitfd6636ebc06d55b59851701c436b8b97f50fd7f4 (patch)
tree9227ae4b2461b4e07f72c71646ed4f0d4b21543b /src/mesa/state_tracker
parent1d933728024f907236ffe95da5f5f0eabf6052c7 (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/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_array.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index c39c1c41f51..040c25b9651 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -143,6 +143,8 @@ st_setup_arrays(struct st_context *st,
GLbitfield userbuf_attribs = inputs_read & _mesa_draw_user_array_bits(ctx);
*has_user_vertex_buffers = userbuf_attribs != 0;
+ st->draw_needs_minmax_index =
+ (userbuf_attribs & ~_mesa_draw_nonzero_divisor_bits(ctx)) != 0;
while (mask) {
/* The attribute index to start pulling a binding */
@@ -164,9 +166,6 @@ st_setup_arrays(struct st_context *st,
vbuffer[bufidx].buffer.user = ptr;
vbuffer[bufidx].is_user_buffer = true;
vbuffer[bufidx].buffer_offset = 0;
-
- if (!binding->InstanceDivisor)
- st->draw_needs_minmax_index = true;
}
vbuffer[bufidx].stride = binding->Stride; /* in bytes */
@@ -296,8 +295,6 @@ st_update_array(struct st_context *st)
unsigned num_velements;
bool uses_user_vertex_buffers;
- st->draw_needs_minmax_index = false;
-
/* ST_NEW_VERTEX_ARRAYS alias ctx->DriverFlags.NewArray */
/* Setup arrays */
st_setup_arrays(st, vp, vp_variant, velements, vbuffer, &num_vbuffers,