struct vtn_block *pred =
vtn_value(b, w[i + 1], vtn_value_type_block)->block;
- b->nb.cursor = nir_after_block_before_jump(pred->end_block);
+ b->nb.cursor = nir_after_instr(&pred->end_nop->instr);
vtn_local_store(b, src, nir_deref_var_create(b, phi_var));
}
vtn_foreach_instruction(b, block_start, block_end, handler);
- block->end_block = nir_cursor_current_block(b->nb.cursor);
+ block->end_nop = nir_intrinsic_instr_create(b->nb.shader,
+ nir_intrinsic_nop);
+ nir_builder_instr_insert(&b->nb, &block->end_nop->instr);
if ((*block->branch & SpvOpCodeMask) == SpvOpReturnValue) {
struct vtn_ssa_value *src = vtn_ssa_value(b, block->branch[1]);
/** Points to the switch case started by this block (if any) */
struct vtn_case *switch_case;
- /** The last block in this SPIR-V block. */
- nir_block *end_block;
+ /** Every block ends in a nop intrinsic so that we can find it again */
+ nir_intrinsic_instr *end_nop;
};
struct vtn_function {