[Mesa-dev] [PATCH v2 11/12] nir: add lower_all_io_to_temps flag

Timothy Arceri tarceri at itsqueeze.com
Tue Jan 30 03:55:37 UTC 2018


This will be used for freedreno and vc4 which require all inputs
and outputs to be copied to temps.
---
 src/broadcom/compiler/nir_to_vir.c          | 1 +
 src/compiler/nir/nir.h                      | 2 ++
 src/gallium/drivers/freedreno/ir3/ir3_nir.c | 1 +
 src/gallium/drivers/vc4/vc4_program.c       | 1 +
 4 files changed, 5 insertions(+)

diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index 46f3c9bc41..0e2e8e2daa 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -1874,6 +1874,7 @@ nir_to_vir(struct v3d_compile *c)
 }
 
 const nir_shader_compiler_options v3d_nir_options = {
+        .lower_all_io_to_temps = true,
         .lower_extract_byte = true,
         .lower_extract_word = true,
         .lower_bitfield_insert = true,
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 86d1c68fa7..9ab2769e06 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1873,6 +1873,8 @@ typedef struct nir_shader_compiler_options {
    bool lower_extract_byte;
    bool lower_extract_word;
 
+   bool lower_all_io_to_temps;
+
    /**
     * Does the driver support real 32-bit integers?  (Otherwise, integers
     * are simulated by floats.)
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index 9ab5e0f7f2..2393306e19 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -50,6 +50,7 @@ static const nir_shader_compiler_options options = {
 		.vertex_id_zero_based = true,
 		.lower_extract_byte = true,
 		.lower_extract_word = true,
+		.lower_all_io_to_temps = true,
 };
 
 struct nir_shader *
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 98cdfdf33e..706982c4a1 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -2180,6 +2180,7 @@ nir_to_qir(struct vc4_compile *c)
 }
 
 static const nir_shader_compiler_options nir_options = {
+        .lower_all_io_to_temps = true,
         .lower_extract_byte = true,
         .lower_extract_word = true,
         .lower_ffma = true,
-- 
2.14.3



More information about the mesa-dev mailing list