st/mesa: do (inputs_read & ~enabled_arrays) outside st_setup_current

also move dual_slot_inputs before inputs_read to match st_setup_array.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27198>
This commit is contained in:
Marek Olšák
2024-01-03 21:38:18 -05:00
committed by Marge Bot
parent c4ba65a33b
commit 3363d41a20

View File

@@ -194,16 +194,15 @@ st_setup_arrays(struct st_context *st,
*/ */
template<util_popcnt POPCNT, st_update_flag UPDATE> void ALWAYS_INLINE template<util_popcnt POPCNT, st_update_flag UPDATE> void ALWAYS_INLINE
st_setup_current(struct st_context *st, st_setup_current(struct st_context *st,
const GLbitfield inputs_read,
const GLbitfield dual_slot_inputs, const GLbitfield dual_slot_inputs,
const GLbitfield enabled_arrays, const GLbitfield inputs_read,
GLbitfield curmask,
struct cso_velems_state *velements, struct cso_velems_state *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers) struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers)
{ {
struct gl_context *ctx = st->ctx; struct gl_context *ctx = st->ctx;
/* Process values that should have better been uniforms in the application */ /* Process values that should have better been uniforms in the application */
GLbitfield curmask = inputs_read & ~enabled_arrays;
if (curmask) { if (curmask) {
unsigned num_attribs = util_bitcount_fast<POPCNT>(curmask); unsigned num_attribs = util_bitcount_fast<POPCNT>(curmask);
unsigned num_dual_attribs = util_bitcount_fast<POPCNT>(curmask & unsigned num_dual_attribs = util_bitcount_fast<POPCNT>(curmask &
@@ -329,8 +328,8 @@ st_update_array_templ(struct st_context *st,
/* _NEW_CURRENT_ATTRIB */ /* _NEW_CURRENT_ATTRIB */
/* Setup zero-stride attribs. */ /* Setup zero-stride attribs. */
st_setup_current<POPCNT, UPDATE>(st, inputs_read, dual_slot_inputs, st_setup_current<POPCNT, UPDATE>(st, dual_slot_inputs, inputs_read,
enabled_arrays, inputs_read & ~enabled_arrays,
&velements, vbuffer, &num_vbuffers); &velements, vbuffer, &num_vbuffers);
struct cso_context *cso = st->cso_context; struct cso_context *cso = st->cso_context;