mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 06:40:11 +01:00
nir/builder: Use nir_after_instr to advance the cursor
This *should* ensure that the cursor gets properly advanced in all cases. We had a problem before where, if the cursor was created using nir_after_cf_node on a non-block cf_node, that would call nir_before_block on the block following the cf node. Instructions would then get inserted in backwards order at the top of the block which is not at all what you would expect from nir_after_cf_node. By just resetting to after_instr, we avoid all these problems.
This commit is contained in:
parent
24b0c53231
commit
ce70cae756
1 changed files with 1 additions and 2 deletions
|
|
@ -49,8 +49,7 @@ nir_builder_instr_insert(nir_builder *build, nir_instr *instr)
|
|||
nir_instr_insert(build->cursor, instr);
|
||||
|
||||
/* Move the cursor forward. */
|
||||
if (build->cursor.option == nir_cursor_after_instr)
|
||||
build->cursor.instr = instr;
|
||||
build->cursor = nir_after_instr(instr);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue