[Mesa-dev] [PATCH] mesa/st: add nir pass for lowering builtin uniforms

Eric Anholt eric at anholt.net
Thu Apr 21 01:37:35 UTC 2016


Rob Clark <robdclark at gmail.com> writes:

> From: Rob Clark <robclark at freedesktop.org>
>
> Signed-off-by: Rob Clark <robclark at freedesktop.org>
> ---
>  src/mesa/Makefile.sources                     |   2 +
>  src/mesa/state_tracker/st_nir.h               |  31 ++++
>  src/mesa/state_tracker/st_nir_lower_builtin.c | 245 ++++++++++++++++++++++++++
>  3 files changed, 278 insertions(+)
>  create mode 100644 src/mesa/state_tracker/st_nir.h
>  create mode 100644 src/mesa/state_tracker/st_nir_lower_builtin.c
>
> diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c b/src/mesa/state_tracker/st_nir_lower_builtin.c
> new file mode 100644
> index 0000000..e8b31f7
> --- /dev/null
> +++ b/src/mesa/state_tracker/st_nir_lower_builtin.c

> +static const struct gl_builtin_uniform_element *
> +get_element(const struct gl_builtin_uniform_desc *desc, nir_deref_var *deref)
> +{
> +   nir_deref *tail = &deref->deref;
> +
> +   if ((desc->num_elements == 1) && (desc->elements[0].field == NULL))
> +      return NULL;
> +
> +   /* we handle array's in get_variable(): */

s/array's/arrays/

Other than that, while this is kind of gross, I guess we have to do it
as long as we're doing uniform storage the same as TGSI, which seems
like the right way to go for now.

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160420/8a993cec/attachment.sig>


More information about the mesa-dev mailing list