Mesa (master): freedreno/ir3: Fix driver_location of the added vertex_flags varying.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 23 19:13:03 UTC 2020


Module: Mesa
Branch: master
Commit: ac937bf878c30f1879adfb31f68a4dec15d3b616
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac937bf878c30f1879adfb31f68a4dec15d3b616

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 22 13:27:20 2020 -0700

freedreno/ir3: Fix driver_location of the added vertex_flags varying.

It was ignoring the sizes of the output variables and assuming
single-slot, and failing to update num_outputs.

Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4670>

---

 src/freedreno/ir3/ir3_nir_lower_tess.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/freedreno/ir3/ir3_nir_lower_tess.c b/src/freedreno/ir3/ir3_nir_lower_tess.c
index 2f2abc10bbb..249e36dad6a 100644
--- a/src/freedreno/ir3/ir3_nir_lower_tess.c
+++ b/src/freedreno/ir3/ir3_nir_lower_tess.c
@@ -890,15 +890,9 @@ ir3_nir_lower_gs(nir_shader *shader, struct ir3_shader *s)
 
 	build_primitive_map(shader, &state.map, &shader->inputs);
 
-	uint32_t loc = 0;
-	nir_foreach_variable (var, &shader->outputs) {
-		uint32_t end = var->data.driver_location + glsl_count_attribute_slots(var->type, false);
-		loc = MAX2(loc, end);
-	}
-
 	state.vertex_flags_out = nir_variable_create(shader, nir_var_shader_out,
 			glsl_uint_type(), "vertex_flags");
-	state.vertex_flags_out->data.driver_location = loc;
+	state.vertex_flags_out->data.driver_location = shader->num_outputs++;
 	state.vertex_flags_out->data.location = VARYING_SLOT_GS_VERTEX_FLAGS_IR3;
 
 	nir_function_impl *impl = nir_shader_get_entrypoint(shader);



More information about the mesa-commit mailing list