summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_remove_dead_variables.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-11-02 21:28:26 -0800
committerKenneth Graunke <[email protected]>2015-11-03 17:06:48 -0800
commit4cb7546066f3f06b8030b8fce78f82469b0c6980 (patch)
tree036ce90b72cc7d5c8a1303df26908d76e00fba31 /src/glsl/nir/nir_remove_dead_variables.c
parent8bb44510fca5315bbdd61502c72c22c7198c0daf (diff)
nir: Properly invalidate metadata in nir_remove_dead_variables().
v2: Preserve live_variables too (Jason). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_remove_dead_variables.c')
-rw-r--r--src/glsl/nir/nir_remove_dead_variables.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c
index d6783e78803..530a8475ed5 100644
--- a/src/glsl/nir/nir_remove_dead_variables.c
+++ b/src/glsl/nir/nir_remove_dead_variables.c
@@ -126,8 +126,14 @@ nir_remove_dead_variables(nir_shader *shader)
progress = remove_dead_vars(&shader->globals, live) || progress;
nir_foreach_overload(shader, overload) {
- if (overload->impl)
- progress = remove_dead_vars(&overload->impl->locals, live) || progress;
+ if (overload->impl) {
+ if (remove_dead_vars(&overload->impl->locals, live)) {
+ nir_metadata_preserve(overload->impl, nir_metadata_block_index |
+ nir_metadata_dominance |
+ nir_metadata_live_variables);
+ progress = true;
+ }
+ }
}
_mesa_set_destroy(live, NULL);