nir: Convert the builder to use the new NIR cursor API.
The NIR cursor API is exactly what we want for the builder's insertion point. This simplifies the API, the implementation, and is actually more flexible as well. This required a bit of reworking of TGSI->NIR's if/loop stack handling; we now store cursors instead of cf_node_lists, for better or worse. v2: Actually move the cursor in the after_instr case. v3: Take advantage of nir_instr_insert (suggested by Connor). v4: vc4 build fixes (thanks to Eric). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> [v1] Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> [v4] Acked-by: Connor Abbott <cwabbott0@gmail.com> [v4]
This commit is contained in:
@@ -84,7 +84,7 @@ get_io_offset(nir_deref_var *deref, nir_instr *instr, nir_src *indirect,
|
||||
unsigned base_offset = 0;
|
||||
|
||||
nir_builder *b = &state->builder;
|
||||
nir_builder_insert_before_instr(b, instr);
|
||||
b->cursor = nir_before_instr(instr);
|
||||
|
||||
nir_deref *tail = &deref->deref;
|
||||
while (tail->child != NULL) {
|
||||
|
Reference in New Issue
Block a user