[Mesa-dev] [PATCH v3 057/104] nir,spirv: Rework function calls

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Mon Apr 9 23:25:15 UTC 2018


Hi,

>  typedef struct {
> -   nir_parameter_type param_type;
> -   const struct glsl_type *type;
> +   uint8_t num_components;
> +   uint8_t bit_size;
>  } nir_parameter;

(...)

> @@ -683,18 +692,12 @@ validate_tex_instr(nir_tex_instr *instr, validate_state *state)
>  static void
>  validate_call_instr(nir_call_instr *instr, validate_state *state)
>  {
> -   if (instr->return_deref == NULL) {
> -      validate_assert(state, glsl_type_is_void(instr->callee->return_type));
> -   } else {
> -      validate_assert(state, instr->return_deref->deref.type == instr->callee->return_type);
> -      validate_deref_var(instr, instr->return_deref, state);
> -   }
> -
>     validate_assert(state, instr->num_params == instr->callee->num_params);
>  
>     for (unsigned i = 0; i < instr->num_params; i++) {
> -      validate_assert(state, instr->callee->params[i].type == instr->params[i]->deref.type);
> -      validate_deref_var(instr, instr->params[i], state);
> +      validate_src(&instr->params[i], state,
> +                   instr->callee->params[i].bit_size,
> +                   instr->callee->params[i].num_components);
>     }
>  }

Question: I might be misreading, but it seems like we are losing the
type information for functions. Isn't that something worth keeping,
maybe in some other way, e.g. load_param specifying the expected type?


Thanks,
Caio


More information about the mesa-dev mailing list