radeonsi: scalarize IO instructions
authorMarek Olšák <marek.olsak@amd.com>
Sun, 2 Jan 2022 04:03:23 +0000 (23:03 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 22 Apr 2022 22:21:11 +0000 (22:21 +0000)
The next commit will rely on this.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14414>

src/gallium/drivers/radeonsi/si_shader_nir.c

index 7e455ac..5c27d4a 100644 (file)
@@ -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