Mesa (7.11): i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.

Ian Romanick idr at kemper.freedesktop.org
Thu Jul 28 18:48:48 UTC 2011


Module: Mesa
Branch: 7.11
Commit: 66b41af39119cced3dbdc1c9a8995df51539d887
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=66b41af39119cced3dbdc1c9a8995df51539d887

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu May 12 04:02:32 2011 -0700

i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.

On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 572f6318954f31fcf3d396ac5df8e9eff3f37c74)

---

 src/mesa/drivers/dri/i965/brw_wm_emit.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c
index f61757a..6ea4a7d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c
@@ -1094,9 +1094,16 @@ void emit_tex(struct brw_wm_compile *c,
    if (intel->gen < 5 && c->dispatch_width == 8)
       nr_texcoords = 3;
 
-   /* For shadow comparisons, we have to supply u,v,r. */
-   if (shadow)
-      nr_texcoords = 3;
+   if (shadow) {
+      if (intel->gen < 7) {
+	 /* For shadow comparisons, we have to supply u,v,r. */
+	 nr_texcoords = 3;
+      } else {
+	 /* On Ivybridge, the shadow comparitor comes first. Just load it. */
+	 brw_MOV(p, brw_message_reg(cur_mrf), arg[2]);
+	 cur_mrf += mrf_per_channel;
+      }
+   }
 
    /* Emit the texcoords. */
    for (i = 0; i < nr_texcoords; i++) {
@@ -1113,7 +1120,7 @@ void emit_tex(struct brw_wm_compile *c,
    }
 
    /* Fill in the shadow comparison reference value. */
-   if (shadow) {
+   if (shadow && intel->gen < 7) {
       if (intel->gen >= 5) {
 	 /* Fill in the cube map array index value. */
 	 brw_MOV(p, brw_message_reg(cur_mrf), brw_imm_f(0));




More information about the mesa-commit mailing list