nir/spirv: A couple simple loop fixes
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Dec 2015 05:26:13 +0000 (21:26 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Dec 2015 20:50:31 +0000 (12:50 -0800)
src/glsl/nir/spirv/spirv_to_nir.c
src/glsl/nir/spirv/vtn_cfg.c

index 16930c461979e28a821ace68f669ed122a982d85..7aea750cb0234a049791c2f7d280c68096b03c90 100644 (file)
@@ -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;
       }
 
index e6258175c198ebf3b2cf89270b134475f879d7a4..ee49dc23791669da4acda5d55890145ae74d2238 100644 (file)
@@ -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;