From cf555dc1c2f24fec070c02d2df29c6f0b3b1e262 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 28 Dec 2015 21:26:13 -0800 Subject: [PATCH] nir/spirv: A couple simple loop fixes --- src/glsl/nir/spirv/spirv_to_nir.c | 4 +++- src/glsl/nir/spirv/vtn_cfg.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index 16930c46197..7aea750cb02 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -3673,8 +3673,10 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list) nir_store_var(&b->nb, do_cont, nir_imm_int(&b->nb, NIR_TRUE), 1); } - b->nb.cursor = nir_after_cf_node(&loop->cf_node); + b->nb.cursor = nir_after_cf_list(&loop->body); vtn_emit_cf_list(b, &vtn_loop->body); + + b->nb.cursor = nir_after_cf_node(&loop->cf_node); break; } diff --git a/src/glsl/nir/spirv/vtn_cfg.c b/src/glsl/nir/spirv/vtn_cfg.c index e6258175c19..ee49dc23791 100644 --- a/src/glsl/nir/spirv/vtn_cfg.c +++ b/src/glsl/nir/spirv/vtn_cfg.c @@ -181,7 +181,7 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list, */ vtn_cfg_walk_blocks(b, &loop->body, block, loop_break, loop_cont, NULL ); - vtn_cfg_walk_blocks(b, &loop->body, loop_cont, NULL, NULL, block); + vtn_cfg_walk_blocks(b, &loop->cont_body, loop_cont, NULL, NULL, block); block = loop_break; continue; -- 2.30.2