diff options
author | Kenneth Graunke <[email protected]> | 2015-08-06 07:16:07 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-08-27 13:36:57 -0700 |
commit | 0a913a9d85f2eb772be6a133965c5b8a4aa3c800 (patch) | |
tree | 228a06adfde6aa9f62808318e0d273a216a29b3c /src/gallium/drivers/vc4 | |
parent | 3e3cb77901c9c9efbf4cf550da80509fe6dbbd9f (diff) |
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 <[email protected]>
Reviewed-by: Eric Anholt <[email protected]> [v1]
Reviewed-by: Jason Ekstrand <[email protected]> [v4]
Acked-by: Connor Abbott <[email protected]> [v4]
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_nir_lower_blend.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_nir_lower_io.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_blend.c b/src/gallium/drivers/vc4/vc4_nir_lower_blend.c index a372a6c0cdc..808cbea8fde 100644 --- a/src/gallium/drivers/vc4/vc4_nir_lower_blend.c +++ b/src/gallium/drivers/vc4/vc4_nir_lower_blend.c @@ -409,7 +409,7 @@ vc4_nir_lower_blend_block(nir_block *block, void *state) nir_cf_node_get_function(&block->cf_node); nir_builder b; nir_builder_init(&b, impl); - nir_builder_insert_before_instr(&b, &intr->instr); + b.cursor = nir_before_instr(&intr->instr); vc4_nir_lower_blend_instr(c, &b, intr); } return true; diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_io.c b/src/gallium/drivers/vc4/vc4_nir_lower_io.c index 229d41147d8..b632370cbb2 100644 --- a/src/gallium/drivers/vc4/vc4_nir_lower_io.c +++ b/src/gallium/drivers/vc4/vc4_nir_lower_io.c @@ -56,7 +56,7 @@ static void vc4_nir_lower_input(struct vc4_compile *c, nir_builder *b, nir_intrinsic_instr *intr) { - nir_builder_insert_before_instr(b, &intr->instr); + b->cursor = nir_before_instr(&intr->instr); if (c->stage == QSTAGE_FRAG && intr->const_index[0] == VC4_NIR_TLB_COLOR_READ_INPUT) { @@ -160,7 +160,7 @@ vc4_nir_lower_output(struct vc4_compile *c, nir_builder *b, /* All TGSI-to-NIR outputs are VEC4. */ assert(intr->num_components == 4); - nir_builder_insert_before_instr(b, &intr->instr); + b->cursor = nir_before_instr(&intr->instr); for (unsigned i = 0; i < intr->num_components; i++) { nir_intrinsic_instr *intr_comp = @@ -189,7 +189,7 @@ vc4_nir_lower_uniform(struct vc4_compile *c, nir_builder *b, return; assert(intr->num_components == 4); - nir_builder_insert_before_instr(b, &intr->instr); + b->cursor = nir_before_instr(&intr->instr); /* Generate scalar loads equivalent to the original VEC4. */ nir_ssa_def *dests[4]; |