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

Author: Kenneth Graunke <[email protected]>
Date:   Sun Aug 10 22:49:55 2014 -0700

i965/vp: Use the sampler for pull constant loads on Gen7/7.5.

This improves performance in Trine 2 at 1280x720 (windowed) on "Very
High" settings by 30% (in the interactive menu) to 45% (in the forest
by the giant frog) on Haswell GT3e.

It also now generates the same assembly on Gen7 as it does on Gen8,
which always used the sampler for both types.

Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Reviewed-by: Matt Turner <[email protected]>

---

 src/mesa/drivers/dri/i965/brw_vec4_vp.cpp |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp
index f9c23ca..f88a371 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp
@@ -545,11 +545,18 @@ vec4_vs_visitor::get_vp_src_reg(const prog_src_register 
&src)
 
          result = src_reg(this, glsl_type::vec4_type);
          src_reg surf_index = 
src_reg(unsigned(prog_data->base.binding_table.pull_constants_start));
-         vec4_instruction *load =
-            new(mem_ctx) vec4_instruction(this, VS_OPCODE_PULL_CONSTANT_LOAD,
-                                          dst_reg(result), surf_index, 
reladdr);
-         load->base_mrf = 14;
-         load->mlen = 1;
+         vec4_instruction *load;
+         if (brw->gen >= 7) {
+            load = new(mem_ctx)
+               vec4_instruction(this, VS_OPCODE_PULL_CONSTANT_LOAD_GEN7,
+                                dst_reg(result), surf_index, reladdr);
+         } else {
+            load = new(mem_ctx)
+               vec4_instruction(this, VS_OPCODE_PULL_CONSTANT_LOAD,
+                                dst_reg(result), surf_index, reladdr);
+            load->base_mrf = 14;
+            load->mlen = 1;
+         }
          emit(load);
          break;
       }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to