From 9f72e22230e6385f17c93dc68c1f95d751deb484 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Wed, 8 May 2024 10:31:45 +0200 Subject: [PATCH] broadcom/compiler: remove unused parameters in vpm read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A few of the parameters are not actually used at all. So let's clean them. Reviewed-by: Alejandro PiƱeiro Signed-off-by: Juan A. Suarez Romero Part-of: --- src/broadcom/compiler/nir_to_vir.c | 36 ++++++++---------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index acc62a092f2..234dfd48f50 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -2196,14 +2196,10 @@ driver_location_compare(const nir_variable *a, const nir_variable *b) } static struct qreg -ntq_emit_vpm_read(struct v3d_compile *c, - uint32_t *num_components_queued, - uint32_t *remaining, - uint32_t vpm_index) +ntq_emit_vpm_read(struct v3d_compile *c, uint32_t num_components) { return vir_LDVPMV_IN(c, - vir_uniform_ui(c, - (*num_components_queued)++)); + vir_uniform_ui(c, num_components)); } static void @@ -2237,8 +2233,7 @@ ntq_setup_vs_inputs(struct v3d_compile *c) } } - unsigned num_components = 0; - uint32_t vpm_components_queued = 0; + uint32_t vpm_components = 0; bool uses_iid = BITSET_TEST(c->s->info.system_values_read, SYSTEM_VALUE_INSTANCE_ID) || BITSET_TEST(c->s->info.system_values_read, @@ -2250,27 +2245,14 @@ ntq_setup_vs_inputs(struct v3d_compile *c) BITSET_TEST(c->s->info.system_values_read, SYSTEM_VALUE_VERTEX_ID_ZERO_BASE); - num_components += uses_iid; - num_components += uses_biid; - num_components += uses_vid; + if (uses_iid) + c->iid = ntq_emit_vpm_read(c, vpm_components++); - for (int i = 0; i < ARRAY_SIZE(c->vattr_sizes); i++) - num_components += c->vattr_sizes[i]; + if (uses_biid) + c->biid = ntq_emit_vpm_read(c, vpm_components++); - if (uses_iid) { - c->iid = ntq_emit_vpm_read(c, &vpm_components_queued, - &num_components, ~0); - } - - if (uses_biid) { - c->biid = ntq_emit_vpm_read(c, &vpm_components_queued, - &num_components, ~0); - } - - if (uses_vid) { - c->vid = ntq_emit_vpm_read(c, &vpm_components_queued, - &num_components, ~0); - } + if (uses_vid) + c->vid = ntq_emit_vpm_read(c, vpm_components++); /* The actual loads will happen directly in nir_intrinsic_load_input */