v2: Preserve live_variables too (Jason).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
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);