From 424bb7357f7d59f559103f08b7ced91a567686f6 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 8 Jun 2022 00:23:12 -0700 Subject: [PATCH] microsoft/spirv_to_dxil: Remove dead IO vars at the end of dxil_spirv_nir_passes() No need to keep them around if they're unused. Moreover, this should allow the linking step to get rid of outputs when the next stage doesn't use them. Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/spirv_to_dxil/dxil_spirv_nir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c index 87addc0a42b..7537e72ff35 100644 --- a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c +++ b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c @@ -665,7 +665,10 @@ dxil_spirv_nir_passes(nir_shader *nir, NIR_PASS_V(nir, dxil_nir_lower_bool_input); NIR_PASS_V(nir, dxil_nir_lower_ubo_array_one_to_static); NIR_PASS_V(nir, nir_opt_dce); - NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_uniform, NULL); + NIR_PASS_V(nir, nir_remove_dead_derefs); + NIR_PASS_V(nir, nir_remove_dead_variables, + nir_var_uniform | nir_var_shader_in | nir_var_shader_out, + NULL); if (nir->info.stage == MESA_SHADER_FRAGMENT) { dxil_sort_ps_outputs(nir);