nir: add lower_all_io_to_temps flag
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 29 Jan 2018 23:55:19 +0000 (10:55 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 30 Jan 2018 22:14:08 +0000 (09:14 +1100)
This will be used for freedreno and vc4 which require all inputs
and outputs to be copied to temps.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/broadcom/compiler/nir_to_vir.c
src/compiler/nir/nir.h
src/gallium/drivers/freedreno/ir3/ir3_nir.c
src/gallium/drivers/vc4/vc4_program.c

index 46f3c9bc41928f23cba4c5af89e6f808f747bc6d..0e2e8e2daad4d2db992770faaf7d4379e9dc979a 100644 (file)
@@ -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,
index 86d1c68fa72a283feb8302deb712d71fc8b6ba47..9ab2769e0675a04dc4874d0ee582d3b8cb68266b 100644 (file)
@@ -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.)
index 9ab5e0f7f256541b9bb1434163350ec6d85e5a8d..2393306e19cbee956273a0ce263e47fc493cd103 100644 (file)
@@ -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 *
index 98cdfdf33ea3bfa540ed6ebfb5362477654bc26a..706982c4a1cc08a8f905bac86d7ffcb63e02acfe 100644 (file)
@@ -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,