From 6299b90fd4738c0d2ab15bf32f15fada571ba025 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 27 Nov 2019 22:30:22 -0500 Subject: st/mesa: remove st_vp_variant::num_inputs Reviewed-by: Dave Airlie --- src/mesa/state_tracker/st_atom_array.c | 2 +- src/mesa/state_tracker/st_program.c | 11 ++++------- src/mesa/state_tracker/st_program.h | 3 --- 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c index 9dafbb01b79..96b9bd33291 100644 --- a/src/mesa/state_tracker/st_atom_array.c +++ b/src/mesa/state_tracker/st_atom_array.c @@ -568,7 +568,7 @@ st_update_array(struct st_context *st) st_setup_current(st, vp, vp_variant, velements, vbuffer, &num_vbuffers); /* Set the array into cso */ - num_velements = vp_variant->num_inputs; + num_velements = vp->num_inputs + vp_variant->key.passthrough_edgeflags; set_vertex_attribs(st, vbuffer, num_vbuffers, velements, num_velements); /* Unreference uploaded buffer resources. */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 12b588d0193..28ee36efeef 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -583,7 +583,6 @@ st_create_vp_variant(struct st_context *st, struct gl_program_parameter_list *params = stvp->Base.Parameters; vpv->key = *key; - vpv->num_inputs = ((struct st_vertex_program*)stvp)->num_inputs; state.stream_output = stvp->state.stream_output; @@ -598,7 +597,6 @@ st_create_vp_variant(struct st_context *st, } if (key->passthrough_edgeflags) { NIR_PASS_V(state.ir.nir, nir_lower_passthrough_edgeflags); - vpv->num_inputs++; finalize = true; } @@ -670,11 +668,9 @@ st_create_vp_variant(struct st_context *st, if (tokens) { tgsi_free_tokens(state.tokens); state.tokens = tokens; - - if (key->passthrough_edgeflags) - vpv->num_inputs++; - } else + } else { fprintf(stderr, "mesa: cannot emulate deprecated features\n"); + } } if (key->lower_depth_clamp) { @@ -726,7 +722,8 @@ st_get_vp_variant(struct st_context *st, if (vpv) { vpv->base.st = key->st; - for (unsigned index = 0; index < vpv->num_inputs; ++index) { + unsigned num_inputs = stvp->num_inputs + key->passthrough_edgeflags; + for (unsigned index = 0; index < num_inputs; ++index) { unsigned attr = stvp->index_to_input[index]; if (attr == ST_DOUBLE_ATTRIB_PLACEHOLDER) continue; diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 65c1577e03c..d4d37b1ebab 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -211,9 +211,6 @@ struct st_vp_variant */ struct st_common_variant_key key; - /** similar to that in st_vertex_program, but with edgeflags info too */ - GLuint num_inputs; - /** Bitfield of VERT_BIT_* bits of mesa vertex processing inputs */ GLbitfield vert_attrib_mask; }; -- cgit v1.2.3