aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-07-16 10:52:25 -0700
committerEric Anholt <[email protected]>2019-07-18 11:28:56 -0700
commit251c64a53dbfe6ed67347e01e54302fbe13e220a (patch)
tree70f60840868771d220ac88592aaefc6d6cd844d3 /src/compiler/nir/nir.c
parentc0640035fba89a0d629b0cd297d494ac2a9f8338 (diff)
nir: Allow internal changes to the instr in nir_shader_lower_instructions().
v3d's NIR txf_ms lowering wants to swizzle around the input coordinates in NIR, but doesn't generate a new txf_ms instructions as replacement. It's pretty easy to allow that in nir_shader_lower_instructions, and it may be common in lowering passes. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.c')
-rw-r--r--src/compiler/nir/nir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index bf7a5fa0b7e..e09cb71bb35 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1876,7 +1876,7 @@ nir_function_impl_lower_instructions(nir_function_impl *impl,
b.cursor = nir_after_instr(instr);
nir_ssa_def *new_def = lower(&b, instr, cb_data);
- if (new_def) {
+ if (new_def && new_def != NIR_LOWER_INSTR_PROGRESS) {
assert(old_def != NULL);
if (new_def->parent_instr->block != instr->block)
preserved = nir_metadata_none;
@@ -1901,6 +1901,9 @@ nir_function_impl_lower_instructions(nir_function_impl *impl,
list_replace(&old_if_uses, &old_def->if_uses);
}
iter = nir_after_instr(instr);
+
+ if (new_def == NIR_LOWER_INSTR_PROGRESS)
+ progress = true;
}
}