From a3464c567cc112bdaca3354dd4bfb883299eab84 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 17 Jun 2020 15:39:18 +0200 Subject: [PATCH] tu: Actually remove dead variables after io lowering I forgot that their derefs would still be lying around, so we need to eliminate them first. Part-of: --- src/freedreno/vulkan/tu_shader.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c index b5d492aed0f..54ea0b86d21 100644 --- a/src/freedreno/vulkan/tu_shader.c +++ b/src/freedreno/vulkan/tu_shader.c @@ -484,9 +484,14 @@ tu_lower_io(nir_shader *shader, struct tu_shader *tu_shader, /* Remove now-unused variables so that when we gather the shader info later * they won't be counted. */ - nir_remove_dead_variables(shader, - nir_var_uniform | nir_var_mem_ubo | nir_var_mem_ssbo, - NULL); + + if (progress) + nir_opt_dce(shader); + + progress |= + nir_remove_dead_variables(shader, + nir_var_uniform | nir_var_mem_ubo | nir_var_mem_ssbo, + NULL); return progress; } -- 2.30.2