[Mesa-dev] [PATCH 3/9] i965/nir: Lower to registers a bit later.

Ian Romanick idr at freedesktop.org
Wed Mar 11 10:29:02 PDT 2015


On 03/09/2015 01:58 AM, Kenneth Graunke wrote:
> We can't safely call nir_optimize() with register present, since several
> passes called in the loop can't handle registers, and will fail asserts.

Doesn't that mean this patch should go before patch 2?

> Notably, nir_lower_vec_alus() and nir_opt_algebraic() really don't want
> registers.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index fbdfc22..c5ed55c 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -108,9 +108,6 @@ fs_visitor::emit_nir_code()
>     nir_lower_io(nir);
>     nir_validate_shader(nir);
>  
> -   nir_lower_locals_to_regs(nir);
> -   nir_validate_shader(nir);
> -
>     nir_remove_dead_variables(nir);
>     nir_validate_shader(nir);
>  
> @@ -125,6 +122,9 @@ fs_visitor::emit_nir_code()
>  
>     nir_optimize(nir);
>  
> +   nir_lower_locals_to_regs(nir);
> +   nir_validate_shader(nir);
> +
>     nir_lower_to_source_mods(nir);
>     nir_validate_shader(nir);
>     nir_copy_prop(nir);



More information about the mesa-dev mailing list