From db92451e23ed8d6a592d02111c6d949a5d6962b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 1 Jan 2022 23:03:23 -0500 Subject: [PATCH] radeonsi: scalarize IO instructions The next commit will rely on this. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_shader_nir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 7e455ac..5c27d4a 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -266,6 +266,12 @@ static void si_lower_nir(struct si_screen *sscreen, struct nir_shader *nir) NIR_PASS_V(nir, nir_lower_system_values); NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); + /* si_nir_kill_outputs and ac_nir_optimize_outputs require outputs to be scalar. */ + if (nir->info.stage == MESA_SHADER_VERTEX || + nir->info.stage == MESA_SHADER_TESS_EVAL || + nir->info.stage == MESA_SHADER_GEOMETRY) + NIR_PASS_V(nir, nir_lower_io_to_scalar, nir_var_shader_out); + if (nir->info.stage == MESA_SHADER_COMPUTE) { if (nir->info.cs.derivative_group == DERIVATIVE_GROUP_QUADS) { /* If we are shuffling local_invocation_id for quad derivatives, we -- 2.7.4