aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-11-27 22:30:22 -0500
committerMarek Olšák <[email protected]>2019-12-09 21:09:28 -0500
commit6299b90fd4738c0d2ab15bf32f15fada571ba025 (patch)
treebc1da6424837a6025eef5e2c5e274c7293aaf1cd /src
parentbc99b22a305be5e5a5f8fdbf57105d220cf4b0ab (diff)
st/mesa: remove st_vp_variant::num_inputs
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atom_array.c2
-rw-r--r--src/mesa/state_tracker/st_program.c11
-rw-r--r--src/mesa/state_tracker/st_program.h3
3 files changed, 5 insertions, 11 deletions
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;
};