nir/builder: Use nir_after_instr to advance the cursor
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 31 Aug 2015 23:54:02 +0000 (16:54 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Sep 2015 00:05:23 +0000 (17:05 -0700)
commitce70cae7562c7651a7fb907b4bd2f6924a00b40c
treef5b957a8daed13aa20cfed42580019e199cd7996
parent24b0c532319b9318e6e5794978c7e1c05e81d76e
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.
src/glsl/nir/nir_builder.h