nir: Convert the builder to use the new NIR cursor API.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 6 Aug 2015 14:16:07 +0000 (07:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 27 Aug 2015 20:36:57 +0000 (13:36 -0700)
commit0a913a9d85f2eb772be6a133965c5b8a4aa3c800
tree228a06adfde6aa9f62808318e0d273a216a29b3c
parent3e3cb77901c9c9efbf4cf550da80509fe6dbbd9f
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]
src/gallium/auxiliary/nir/tgsi_to_nir.c
src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
src/gallium/drivers/vc4/vc4_nir_lower_blend.c
src/gallium/drivers/vc4/vc4_nir_lower_io.c
src/glsl/nir/nir_builder.h
src/glsl/nir/nir_lower_idiv.c
src/glsl/nir/nir_lower_io.c
src/glsl/nir/nir_lower_load_const_to_scalar.c
src/glsl/nir/nir_lower_tex_projector.c
src/glsl/nir/nir_normalize_cubemap_coords.c
src/mesa/program/prog_to_nir.c