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

Kenneth Graunke kenneth at whitecape.org
Mon Mar 9 01:58:53 PDT 2015


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.

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);
-- 
2.2.1



More information about the mesa-dev mailing list