radv: Only call remove_dead_variables once.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 8 Jan 2017 21:39:36 +0000 (22:39 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 12 Jan 2017 20:39:41 +0000 (21:39 +0100)
Port of 43e0b0d4b255d910616c10e3e01bfec5db469e0e
"anv/pipeline: Only call remove_dead_variables once"

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/amd/vulkan/radv_pipeline.c

index 61af01ca9e49124ecc12513e033e12acff26caed..03603f5ecc2cd6dcab6aeaa8c2e1d3fee924b1ed 100644 (file)
@@ -219,9 +219,9 @@ radv_shader_compile_to_nir(struct radv_device *device,
                assert(exec_list_length(&nir->functions) == 1);
                entry_point->name = ralloc_strdup(entry_point, "main");
 
-               nir_remove_dead_variables(nir, nir_var_shader_in);
-               nir_remove_dead_variables(nir, nir_var_shader_out);
-               nir_remove_dead_variables(nir, nir_var_system_value);
+               nir_remove_dead_variables(nir, nir_var_shader_in |
+                                              nir_var_shader_out |
+                                              nir_var_system_value);
                nir_validate_shader(nir);
 
                nir_lower_system_values(nir);