[Mesa-dev] [PATCH 04/23] nir: Return progress from nir_lower_vars_to_ssa().

Jason Ekstrand jason at jlekstrand.net
Thu Mar 16 22:24:12 UTC 2017


On Thu, Mar 16, 2017 at 2:18 PM, Matt Turner <mattst88 at gmail.com> wrote:

> ---
>  src/compiler/nir/nir.h                   | 2 +-
>  src/compiler/nir/nir_lower_vars_to_ssa.c | 8 ++++++--
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 2dedb45..acbe91c 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -2390,7 +2390,7 @@ bool nir_is_per_vertex_io(nir_variable *var,
> gl_shader_stage stage);
>  void nir_lower_io_types(nir_shader *shader);
>  void nir_lower_regs_to_ssa_impl(nir_function_impl *impl);
>  void nir_lower_regs_to_ssa(nir_shader *shader);
> -void nir_lower_vars_to_ssa(nir_shader *shader);
> +bool nir_lower_vars_to_ssa(nir_shader *shader);
>
>  bool nir_remove_dead_variables(nir_shader *shader, nir_variable_mode
> modes);
>  bool nir_lower_constant_initializers(nir_shader *shader,
> diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c
> b/src/compiler/nir/nir_lower_vars_to_ssa.c
> index 37a786c..e5a12eb 100644
> --- a/src/compiler/nir/nir_lower_vars_to_ssa.c
> +++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
> @@ -737,11 +737,15 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
>     return progress;
>  }
>
> -void
> +bool
>  nir_lower_vars_to_ssa(nir_shader *shader)
>  {
> +   bool progress = false;
> +
>     nir_foreach_function(function, shader) {
>        if (function->impl)
> -         nir_lower_vars_to_ssa_impl(function->impl);
> +         progress |= nir_lower_vars_to_ssa_impl(function->impl);
>

Already had a concept of progress and just didn't wire it up?  Good work
me. :(


>     }
> +
> +   return progress;
>  }
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170316/f25e798a/attachment.html>


More information about the mesa-dev mailing list