Timothy Arceri <tarc...@itsqueeze.com> writes:

> The initial helpers as support for removing unused varyings between
> stages.
> ---
>  src/compiler/Makefile.sources          |   1 +
>  src/compiler/nir/nir.h                 |   6 ++
>  src/compiler/nir/nir_linking_helpers.c | 136 
> +++++++++++++++++++++++++++++++++
>  3 files changed, 143 insertions(+)
>  create mode 100644 src/compiler/nir/nir_linking_helpers.c
>
> diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
> index 0153df2d812..9c7f057eecf 100644
> --- a/src/compiler/Makefile.sources
> +++ b/src/compiler/Makefile.sources
> @@ -203,6 +203,7 @@ NIR_FILES = \
>       nir/nir_instr_set.h \
>       nir/nir_intrinsics.c \
>       nir/nir_intrinsics.h \
> +     nir/nir_linking_helpers.c \
>       nir/nir_liveness.c \
>       nir/nir_loop_analyze.c \
>       nir/nir_loop_analyze.h \
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index e52a1006896..1e89c74d14c 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -2448,6 +2448,12 @@ void nir_shader_gather_info(nir_shader *shader, 
> nir_function_impl *entrypoint);
>  void nir_assign_var_locations(struct exec_list *var_list, unsigned *size,
>                                int (*type_size)(const struct glsl_type *));
>  
> +/* Some helpers to do very simple linking */
> +bool nir_remove_unwritten_outputs(nir_shader *shader);
> +bool nir_remove_unread_outputs(nir_shader *shader, uint64_t outputs_read);
> +bool nir_remove_unused_varyings(nir_shader *producer, nir_shader *consumer);
> +bool nir_compact_varyings(nir_shader *producer, nir_shader *consumer);

It looks like only one of these functions is actually defined by this
patch.  I was hoping to use nir_remove_unread_outputs() from vc4 for my
coordinate shaders.  Other than that,

Reviewed-by: Eric Anholt <e...@anholt.net>

Have you looked at extending linking to garbage collect unused
individual components?  That's where I think I'd get the most win in
vc4, and I recall being concerned about that when I was working on i965,
as well.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to