From 8909f7423567a6902320c1a2e83abd501223fb84 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 13 Oct 2013 14:39:30 +0100 Subject: 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 --- src/sna/brw/brw_wm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/sna/brw/brw_wm.c') 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 { -- cgit v1.2.3