From: Jason Ekstrand Date: Tue, 29 Dec 2015 05:26:13 +0000 (-0800) Subject: nir/spirv: A couple simple loop fixes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf555dc1c2f24fec070c02d2df29c6f0b3b1e262;p=mesa.git nir/spirv: A couple simple loop fixes --- 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;