X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=inline;f=src%2Fcompiler%2Fspirv%2Fvtn_cfg.c;h=25e2f285e79942f1c9f9d37f3300748b4bf807d4;hb=2365520c9d321c015a8e6751351d75cffea5008f;hp=a645149008125af87499d6d9f7d6831ca0d0a6f6;hpb=7f106a2b5d0b27c1ce47a4b335c4cc8ae9cd460b;p=mesa.git diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index a6451490081..25e2f285e79 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -274,9 +274,12 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode, unsigned idx = 0; if (func_type->return_type->base_type != vtn_base_type_void) { + nir_address_format addr_format = + vtn_mode_to_address_format(b, vtn_variable_mode_function); /* The return value is a regular pointer */ func->params[idx++] = (nir_parameter) { - .num_components = 1, .bit_size = 32, + .num_components = nir_address_format_num_components(addr_format), + .bit_size = nir_address_format_bit_size(addr_format), }; } @@ -315,7 +318,6 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode, vtn_push_value(b, w[2], vtn_value_type_sampled_image); val->sampled_image = ralloc(b, struct vtn_sampled_image); - val->sampled_image->type = type; struct vtn_type *sampler_type = rzalloc(b, struct vtn_type); sampler_type->base_type = vtn_base_type_sampler; @@ -809,6 +811,11 @@ vtn_handle_phi_second_pass(struct vtn_builder *b, SpvOp opcode, struct vtn_block *pred = vtn_value(b, w[i + 1], vtn_value_type_block)->block; + /* If block does not have end_nop, that is because it is an unreacheable + * block, and hence it is not worth to handle it */ + if (!pred->end_nop) + continue; + b->nb.cursor = nir_after_instr(&pred->end_nop->instr); struct vtn_ssa_value *src = vtn_ssa_value(b, w[i]);