ac/nir/ps: remove used nir_variable if created
authorQiang Yu <yuq825@gmail.com>
Thu, 30 Mar 2023 09:17:07 +0000 (17:17 +0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 26 Apr 2023 03:27:26 +0000 (03:27 +0000)
RADV won't do this, so remove them at last.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22199>

src/amd/common/ac_nir_lower_ps.c

index 0809bad..5c7775d 100644 (file)
@@ -844,4 +844,8 @@ ac_nir_lower_ps(nir_shader *nir, const ac_nir_lower_ps_options *options)
    init_interp_param(b, &state);
 
    export_ps_outputs(b, &state);
+
+   /* Cleanup nir variable, as RADV won't do this. */
+   if (state.lower_load_barycentric)
+      nir_lower_vars_to_ssa(nir);
 }