summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2019-08-27 11:32:24 -0700
committerKenneth Graunke <kenneth@whitecape.org>2019-09-17 14:27:51 -0700
commitf8c44e4ed7886a7c81cbe86521fa6728efd27f5c (patch)
tree0188b6c3768f3335bdb5be95a5df2ca794b0fe25 /src/gallium
parentf76a724e06842119cbcac83e9c3c938ba9022b02 (diff)
downloadmesa-f8c44e4ed7886a7c81cbe86521fa6728efd27f5c.tar.gz
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@intel.com>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_program.c9
-rw-r--r--src/gallium/drivers/iris/iris_state.c2
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);
}