diff options
author | Marek Olšák <[email protected]> | 2020-01-22 22:23:09 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-02-14 18:16:27 -0500 |
commit | 1d933728024f907236ffe95da5f5f0eabf6052c7 (patch) | |
tree | 8f580b7c4c402f93cf808544b9bd177a0d8c79ad /src | |
parent | 61e4c582e0fe246ac0d494a2391573f63e1ee0dc (diff) |
st/mesa: simplify determination whether a draw has user vertex buffers
Reviewed-by: Mathias Fröhlich <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_atom_array.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c index bbbe0e236d3..c39c1c41f51 100644 --- a/src/mesa/state_tracker/st_atom_array.c +++ b/src/mesa/state_tracker/st_atom_array.c @@ -137,10 +137,13 @@ st_setup_arrays(struct st_context *st, const struct gl_vertex_array_object *vao = ctx->Array._DrawVAO; const GLbitfield inputs_read = vp_variant->vert_attrib_mask; const ubyte *input_to_index = vp->input_to_index; - bool uses_user_vertex_buffers = false; /* Process attribute array data. */ GLbitfield mask = inputs_read & _mesa_draw_array_bits(ctx); + GLbitfield userbuf_attribs = inputs_read & _mesa_draw_user_array_bits(ctx); + + *has_user_vertex_buffers = userbuf_attribs != 0; + while (mask) { /* The attribute index to start pulling a binding */ const gl_vert_attrib i = ffs(mask) - 1; @@ -162,7 +165,6 @@ st_setup_arrays(struct st_context *st, vbuffer[bufidx].is_user_buffer = true; vbuffer[bufidx].buffer_offset = 0; - uses_user_vertex_buffers = true; if (!binding->InstanceDivisor) st->draw_needs_minmax_index = true; } @@ -185,7 +187,6 @@ st_setup_arrays(struct st_context *st, input_to_index[attr]); } } - *has_user_vertex_buffers = uses_user_vertex_buffers; } /* ALWAYS_INLINE helps the compiler realize that most of the parameters are |