diff options
author | Jason Ekstrand <[email protected]> | 2020-04-22 15:49:25 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-24 09:43:21 +0000 |
commit | bc5c43828970b49a9c6b2d08d9fb7f46a3300ae4 (patch) | |
tree | 2a3330a4356e4d9e6d5550712ffba132edd4f302 /src/compiler | |
parent | a1a08a58025a6026aae0f73b67451198f5befb42 (diff) |
spirv: Fix passing combined image/samplers through function calls
Fixes dEQP-VK.spirv_assembly.instruction.function_params.sampler_param
cc: [email protected]
Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4684>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/spirv/vtn_cfg.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index dca8a70dda5..8bd57fb92cb 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -216,9 +216,9 @@ vtn_handle_function_call(struct vtn_builder *b, SpvOp opcode, vtn_value(b, arg_id, vtn_value_type_sampled_image)->sampled_image; call->params[param_idx++] = - nir_src_for_ssa(&sampled_image->image->deref->dest.ssa); + nir_src_for_ssa(vtn_pointer_to_ssa(b, sampled_image->image)); call->params[param_idx++] = - nir_src_for_ssa(&sampled_image->sampler->deref->dest.ssa); + nir_src_for_ssa(vtn_pointer_to_ssa(b, sampled_image->sampler)); } else if (arg_type->base_type == vtn_base_type_pointer || arg_type->base_type == vtn_base_type_image || arg_type->base_type == vtn_base_type_sampler) { @@ -327,12 +327,16 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode, val->sampled_image = ralloc(b, struct vtn_sampled_image); + struct vtn_type *image_type = rzalloc(b, struct vtn_type); + image_type->base_type = vtn_base_type_image; + image_type->type = type->type; + struct vtn_type *sampler_type = rzalloc(b, struct vtn_type); sampler_type->base_type = vtn_base_type_sampler; sampler_type->type = glsl_bare_sampler_type(); val->sampled_image->image = - vtn_load_param_pointer(b, type, b->func_param_idx++); + vtn_load_param_pointer(b, image_type, b->func_param_idx++); val->sampled_image->sampler = vtn_load_param_pointer(b, sampler_type, b->func_param_idx++); } else if (type->base_type == vtn_base_type_pointer && |