summaryrefslogtreecommitdiff
path: root/src/sna/brw
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-13 14:39:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-10-14 09:44:37 +0100
commit8909f7423567a6902320c1a2e83abd501223fb84 (patch)
treea55ca142bc46349c87bcb34f2c09c97360bff660 /src/sna/brw
parent21577742e75165cb2bf34b1cab5bb2c3794c5b49 (diff)
sna/gen6+: Fix calculation of 1/z for projective textures
A typo crept in causing the shader to read from the wrong temporaries for the invert operation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/brw')
-rw-r--r--src/sna/brw/brw_wm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sna/brw/brw_wm.c b/src/sna/brw/brw_wm.c
index e8dc6ac4..03a45d9d 100644
--- a/src/sna/brw/brw_wm.c
+++ b/src/sna/brw/brw_wm.c
@@ -521,7 +521,7 @@ static void brw_wm_projective_st(struct brw_compile *p, int dw,
if (p->gen >= 060) {
/* First compute 1/z */
brw_PLN(p,
- brw_message_reg(msg),
+ brw_vec8_grf(30, 0),
brw_vec1_grf(uv+1, 0),
brw_vec8_grf(2, 0));
@@ -531,23 +531,23 @@ static void brw_wm_projective_st(struct brw_compile *p, int dw,
brw_math_invert(p, brw_vec8_grf(31, 0), brw_vec8_grf(31, 0));
brw_set_compression_control(p, BRW_COMPRESSION_COMPRESSED);
} else
- brw_math_invert(p, brw_vec8_grf(30, 0), brw_vec8_grf(30, 0));
+ brw_math_invert(p, brw_vec8_grf(30, 0), brw_message_reg(msg));
+
brw_PLN(p,
- brw_vec8_grf(28, 0),
+ brw_vec8_grf(26, 0),
brw_vec1_grf(uv, 0),
brw_vec8_grf(2, 0));
- brw_MUL(p,
- brw_message_reg(msg),
- brw_vec8_grf(28, 0),
- brw_vec8_grf(30, 0));
- msg += dw/8;
-
brw_PLN(p,
brw_vec8_grf(28, 0),
brw_vec1_grf(uv, 0),
brw_vec8_grf(4, 0));
+
brw_MUL(p,
brw_message_reg(msg),
+ brw_vec8_grf(26, 0),
+ brw_vec8_grf(30, 0));
+ brw_MUL(p,
+ brw_message_reg(msg + dw/8),
brw_vec8_grf(28, 0),
brw_vec8_grf(30, 0));
} else {