[Mesa-dev] [PATCH v3 4/4] spirv: add support for images and samplers as function arguments

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Nov 28 10:09:47 UTC 2017


This patch is still unreviewed.

Sam

On Wed, 2017-10-18 at 09:54 +0200, Samuel Iglesias Gonsálvez wrote:
> Fixes:
> 
> dEQP-VK.spirv_assembly.instruction.*.image_sampler.*
> 
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/compiler/spirv/vtn_cfg.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/src/compiler/spirv/vtn_cfg.c
> b/src/compiler/spirv/vtn_cfg.c
> index 25ff254bcec..8b139068fb0 100644
> --- a/src/compiler/spirv/vtn_cfg.c
> +++ b/src/compiler/spirv/vtn_cfg.c
> @@ -111,6 +111,25 @@ vtn_cfg_handle_prepass_instruction(struct
> vtn_builder *b, SpvOp opcode,
>           param->name = ralloc_strdup(param, val->name);
>  
>           val->pointer = vtn_pointer_for_variable(b, vtn_var, type);
> +      } else if (type->base_type == vtn_base_type_image || type-
> >base_type == vtn_base_type_sampler) {
> +         struct vtn_variable *vtn_var = rzalloc(b, struct
> vtn_variable);
> +         struct vtn_type *ptr_type = rzalloc(b, struct vtn_type);
> +         ptr_type->deref = type;
> +         ptr_type->base_type = vtn_base_type_pointer;
> +
> +         vtn_var->type = type;
> +         vtn_var->var = param;
> +         vtn_var->mode = (type->base_type == vtn_base_type_image) ?
> +            vtn_variable_mode_image : vtn_variable_mode_sampler;
> +         param->interface_type = type->type;
> +
> +         struct vtn_value *val =
> +            vtn_push_value(b, w[2], vtn_value_type_pointer);
> +
> +         /* Name the parameter so it shows up nicely in NIR */
> +         param->name = ralloc_strdup(param, val->name);
> +
> +         val->pointer = vtn_pointer_for_variable(b, vtn_var,
> ptr_type);
>        } else {
>           /* We're a regular SSA value. */
>           struct vtn_ssa_value *param_ssa =


More information about the mesa-dev mailing list