Mesa (master): iris: Skip allocating a null surface when there are 0 color regions.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 17 22:16:22 UTC 2019


Module: Mesa
Branch: master
Commit: f8c44e4ed7886a7c81cbe86521fa6728efd27f5c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8c44e4ed7886a7c81cbe86521fa6728efd27f5c

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Aug 27 11:32:24 2019 -0700

iris: Skip allocating a null surface when there are 0 color regions.

The compiler now sets the "Null Render Target" bit in the RT write
extended message descriptor, causing it to write to an implicit null
surface without us needing to set one up in the binding table.

Together with the last patch, this improves performance in Car Chase on
an Icelake 8x8 (locked to 700Mhz) by 0.0445526% +/- 0.0132736% (n=832).

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>

---

 src/gallium/drivers/iris/iris_program.c | 9 ++++++++-
 src/gallium/drivers/iris/iris_state.c   | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 9eb7a47e1f1..50ea72ab9ec 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -1522,8 +1522,15 @@ iris_compile_fs(struct iris_context *ice,
     */
    brw_nir_lower_fs_outputs(nir);
 
+   /* On Gen11+, shader RT write messages have a "Null Render Target" bit
+    * and do not need a binding table entry with a null surface.  Earlier
+    * generations need an entry for a null surface.
+    */
+   int null_rts = devinfo->gen < 11 ? 1 : 0;
+
    struct iris_binding_table bt;
-   iris_setup_binding_table(devinfo, nir, &bt, MAX2(key->nr_color_regions, 1),
+   iris_setup_binding_table(devinfo, nir, &bt,
+                            MAX2(key->nr_color_regions, null_rts),
                             num_system_values, num_cbufs);
 
    brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 3fca191937d..d45b1736af3 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -4337,7 +4337,7 @@ iris_populate_binding_table(struct iris_context *ice,
             }
             push_bt_entry(addr);
          }
-      } else {
+      } else if (GEN_GEN < 11) {
          uint32_t addr = use_null_fb_surface(batch, ice);
          push_bt_entry(addr);
       }




More information about the mesa-commit mailing list