[Mesa-dev] [PATCH v3 019/104] nir: Support deref instructions in lower_var_copies

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Thu Apr 5 19:55:05 UTC 2018


Hello,

> +static nir_deref_instr *
> +build_deref_to_next_wildcard(nir_builder *b,
> +                             nir_deref_instr *parent,
> +                             nir_deref_instr ***deref_arr)
> +{
> +   for (; **deref_arr; (*deref_arr)++) {
> +      if ((**deref_arr)->deref_type == nir_deref_type_array_wildcard)
> +         return parent;
> +
> +      parent = nir_build_deref_follower(b, parent, **deref_arr);
> +   }
> +
> +   assert(**deref_arr == NULL);
> +   *deref_arr = NULL;
> +   return parent;
> +}

Question: in a scenario where there are no wildcards in the chain,
could we just return the original deref (i.e. the last element in
deref_arr)?


Thanks,
Caio


More information about the mesa-dev mailing list