Mesa (master): i965/fs: Support pull parameters in SIMD16 mode.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Mar 18 17:36:10 UTC 2014


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Mar  7 16:10:50 2014 -0800

i965/fs: Support pull parameters in SIMD16 mode.

This is just a matter of reusing the pull/push constant information set
up by the SIMD8 compile.

This gains us 78 SIMD16 programs in shader-db.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp         |   21 +++++++++++----------
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    3 ++-
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 054bed5..1f85901 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -886,7 +886,9 @@ fs_visitor::import_uniforms(fs_visitor *v)
 			   import_uniforms_callback,
 			   variable_ht);
    this->push_constant_loc = v->push_constant_loc;
+   this->pull_constant_loc = v->pull_constant_loc;
    this->uniforms = v->uniforms;
+   this->param_size = v->param_size;
 }
 
 /* Our support for uniforms is piggy-backed on the struct
@@ -1748,6 +1750,9 @@ fs_visitor::compact_virtual_grfs()
 void
 fs_visitor::move_uniform_array_access_to_pull_constants()
 {
+   if (dispatch_width != 8)
+      return;
+
    pull_constant_loc = ralloc_array(mem_ctx, int, uniforms);
 
    for (unsigned int i = 0; i < uniforms; i++) {
@@ -3500,17 +3505,13 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
    exec_list *simd16_instructions = NULL;
    fs_visitor v2(brw, c, prog, fp, 16);
    if (brw->gen >= 5 && likely(!(INTEL_DEBUG & DEBUG_NO16))) {
-      if (c->prog_data.base.nr_pull_params == 0) {
-         /* Try a SIMD16 compile */
-         v2.import_uniforms(&v);
-         if (!v2.run()) {
-            perf_debug("SIMD16 shader failed to compile, falling back to "
-                       "SIMD8 at a 10-20%% performance cost: %s", v2.fail_msg);
-         } else {
-            simd16_instructions = &v2.instructions;
-         }
+      /* Try a SIMD16 compile */
+      v2.import_uniforms(&v);
+      if (!v2.run()) {
+         perf_debug("SIMD16 shader failed to compile, falling back to "
+                    "SIMD8 at a 10-20%% performance cost: %s", v2.fail_msg);
       } else {
-         perf_debug("Skipping SIMD16 due to pull parameters.\n");
+         simd16_instructions = &v2.instructions;
       }
    }
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 7088502..cd90e23 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2978,7 +2978,8 @@ fs_visitor::fs_visitor(struct brw_context *brw,
 
    this->spilled_any_registers = false;
 
-   this->param_size = rzalloc_array(mem_ctx, int, stage_prog_data->nr_params);
+   if (dispatch_width == 8)
+      this->param_size = rzalloc_array(mem_ctx, int, stage_prog_data->nr_params);
 }
 
 fs_visitor::~fs_visitor()




More information about the mesa-commit mailing list