summaryrefslogtreecommitdiff
path: root/lib/mesa/src/compiler/nir/nir_builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/compiler/nir/nir_builder.h')
-rw-r--r--lib/mesa/src/compiler/nir/nir_builder.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mesa/src/compiler/nir/nir_builder.h b/lib/mesa/src/compiler/nir/nir_builder.h
index 37711abe6..f277d89c2 100644
--- a/lib/mesa/src/compiler/nir/nir_builder.h
+++ b/lib/mesa/src/compiler/nir/nir_builder.h
@@ -103,17 +103,19 @@ nir_shader_instructions_pass(nir_shader *shader,
if (!function->impl)
continue;
+ bool func_progress = false;
nir_builder b;
nir_builder_init(&b, function->impl);
nir_foreach_block_safe(block, function->impl) {
nir_foreach_instr_safe(instr, block) {
- progress |= pass(&b, instr, cb_data);
+ func_progress |= pass(&b, instr, cb_data);
}
}
- if (progress) {
+ if (func_progress) {
nir_metadata_preserve(function->impl, preserved);
+ progress = true;
} else {
nir_metadata_preserve(function->impl, nir_metadata_all);
}