Mesa (9.2): i965/fs: Gen4: Zero out extra coordinates when using shadow compare

Carl Worth cworth at kemper.freedesktop.org
Fri Sep 27 23:03:18 UTC 2013


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

Author: Chris Forbes <chrisf at ijw.co.nz>
Date:   Tue Aug 27 19:35:49 2013 +1200

i965/fs: Gen4: Zero out extra coordinates when using shadow compare

Fixes broken rendering if these MRFs contained anything other than zero.

NOTE: This is a candidate for stable branches.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit f35dea05b1329b9303a11fb803897fb189ff99b4)

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 0b17dc7..b52690b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -868,7 +868,13 @@ fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate,
 	 emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
 	 coordinate.reg_offset++;
       }
-      /* gen4's SIMD8 sampler always has the slots for u,v,r present. */
+
+      /* gen4's SIMD8 sampler always has the slots for u,v,r present.
+       * the unused slots must be zeroed.
+       */
+      for (int i = ir->coordinate->type->vector_elements; i < 3; i++) {
+         emit(MOV(fs_reg(MRF, base_mrf + mlen + i), fs_reg(0.0f)));
+      }
       mlen += 3;
 
       if (ir->op == ir_tex) {




More information about the mesa-commit mailing list