From: Jason Ekstrand Date: Thu, 30 Apr 2015 03:19:34 +0000 (-0700) Subject: nir/spirv: Add support for OpLabel X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=befecb3c553fd7418ff9bc8a85e685b84621cb58;p=mesa.git nir/spirv: Add support for OpLabel --- diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index 67db9a99e9e..5b171ece8bf 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -40,6 +40,7 @@ enum vtn_value_type { vtn_value_type_constant, vtn_value_type_variable, vtn_value_type_function, + vtn_value_type_block, vtn_value_type_ssa, vtn_value_type_deref, }; @@ -55,6 +56,7 @@ struct vtn_value { nir_constant *constant; nir_variable *var; nir_function_impl *impl; + nir_block *block; nir_ssa_def *ssa; nir_deref_var *deref; }; @@ -612,6 +614,17 @@ vtn_handle_instruction(struct vtn_builder *b, SpvOp opcode, b->execution_model = w[1]; break; + case SpvOpLabel: { + struct exec_node *list_tail = exec_list_get_tail(b->cf_list); + nir_cf_node *tail_node = exec_node_data(nir_cf_node, list_tail, node); + assert(tail_node->type == nir_cf_node_block); + nir_block *block = nir_cf_node_as_block(tail_node); + + assert(exec_list_is_empty(&block->instr_list)); + vtn_push_value(b, w[1], vtn_value_type_block)->block = block; + break; + } + case SpvOpExtInstImport: case SpvOpExtInst: vtn_handle_extension(b, opcode, w, count);