Mesa (7.10): i965/fs: Switch W and 1/W in Sandybridge interpolation setup.

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Apr 11 20:22:26 UTC 2011


Module: Mesa
Branch: 7.10
Commit: 6c7a5d52ee04a6761acf64cd7b53f94deb547576
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c7a5d52ee04a6761acf64cd7b53f94deb547576

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sun Apr  3 01:39:28 2011 -0700

i965/fs: Switch W and 1/W in Sandybridge interpolation setup.

Various documentation mentions that "W" is handed to the WM stage,
but further digging seems to indicate that they really mean 1/W.

The code here is still unclear, but changing this fixes piglit
test "fragcoord_w" on Sandybridge as well as a Khronos ES2 conformance
test.  I also tested 3DMarkMobile ES2.0's taiji and hoverjet demos, as
well as Nexuiz, just to be safe.

(cherry-picked from commit 5d7fefb9afbcc6f1d58a92d07c390e6b912c3b00)

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    8 ++++----
 1 files 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 524dfaa..b38a290 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2004,10 +2004,10 @@ fs_visitor::emit_interpolation_setup_gen6()
    emit(fs_inst(BRW_OPCODE_MOV, this->pixel_x, int_pixel_x));
    emit(fs_inst(BRW_OPCODE_MOV, this->pixel_y, int_pixel_y));
 
-   this->current_annotation = "compute 1/pos.w";
-   this->wpos_w = fs_reg(brw_vec8_grf(c->source_w_reg, 0));
-   this->pixel_w = fs_reg(this, glsl_type::float_type);
-   emit_math(FS_OPCODE_RCP, this->pixel_w, wpos_w);
+   this->current_annotation = "compute pos.w";
+   this->pixel_w = fs_reg(brw_vec8_grf(c->source_w_reg, 0));
+   this->wpos_w = fs_reg(this, glsl_type::float_type);
+   emit_math(FS_OPCODE_RCP, this->wpos_w, this->pixel_w);
 
    this->delta_x = fs_reg(brw_vec8_grf(2, 0));
    this->delta_y = fs_reg(brw_vec8_grf(3, 0));




More information about the mesa-commit mailing list