spirv: Move cursor before calling vtn_ssa_value() in phi 2nd pass.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Jan 2017 07:03:25 +0000 (23:03 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 10 Jan 2017 00:52:02 +0000 (16:52 -0800)
commit203c1287816f2a73475a48dd72a9a2ed03a42ac1
tree89506b9514fb2abbf12867544554ae48273f486d
parent230b756f865e2d6ae17ff9568c8dcb718840c7b2
spirv: Move cursor before calling vtn_ssa_value() in phi 2nd pass.

vtn_ssa_value() can produce variable loads, and the cursor might
be after a return statement, causing nir_builder assert failures
about not inserting instructions after a jump.

This fixes:
dEQP-VK.spirv_assembly.instruction.graphics.barrier.in_if
dEQP-VK.spirv_assembly.instruction.graphics.barrier.in_switch

Cc: "13.0 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/vtn_cfg.c