Module: Mesa
Branch: 10.6
Commit: 34d34076ff9e2ed3aeb5d5df4685d44d5c7b4b8f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=34d34076ff9e2ed3aeb5d5df4685d44d5c7b4b8f

Author: Matt Turner <[email protected]>
Date:   Wed Sep  2 12:49:08 2015 -0700

i965/fs: Handle MRF destinations in lower_integer_multiplication().

The lowered code reads from the destination, which isn't possible from
message registers.

Fixes the following dEQP tests on SNB:

    dEQP-GLES3.functional.shaders.precision.int.highp_mul_fragment
    dEQP-GLES3.functional.shaders.precision.int.mediump_mul_fragment
    dEQP-GLES3.functional.shaders.precision.int.lowp_mul_fragment

Cc: "10.6 11.0" <[email protected]>
Tested-by:  Mark Janes <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
(cherry picked from commit 9390cb84593bda516e8c1521c87a08475574d1be)

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 6790a5e..bbf9c23 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3607,7 +3607,8 @@ fs_visitor::lower_integer_multiplication()
           * schedule multi-component multiplications much better.
           */
 
-         if (inst->conditional_mod && inst->dst.is_null()) {
+         fs_reg orig_dst = inst->dst;
+         if (orig_dst.is_null() || orig_dst.file == MRF) {
             inst->dst = fs_reg(GRF, alloc.allocate(dispatch_width / 8),
                                inst->dst.type, dispatch_width);
          }
@@ -3673,9 +3674,8 @@ fs_visitor::lower_integer_multiplication()
 
          insert(ADD(dst, low, high));
 
-         if (inst->conditional_mod) {
-            fs_reg null(retype(brw_null_reg(), inst->dst.type));
-            fs_inst *mov = MOV(null, inst->dst);
+         if (inst->conditional_mod || orig_dst.file == MRF) {
+            fs_inst *mov = MOV(orig_dst, inst->dst);
             mov->conditional_mod = inst->conditional_mod;
             insert(mov);
          }

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

Reply via email to