Mesa (7.10): i965: Fix gl_FragCoord.z setup on gen6.

Eric Anholt anholt at kemper.freedesktop.org
Mon Dec 27 22:31:22 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Dec 13 13:37:54 2010 -0800

i965: Fix gl_FragCoord.z setup on gen6.

Fixes glsl-bug-22603.
(cherry picked from commit 036c817f77f71e7c4b17571ae100a9bc93d8fe5b)

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c3cbe0d..4eead32 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -474,8 +474,13 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)
    wpos.reg_offset++;
 
    /* gl_FragCoord.z */
-   emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y,
-		interp_reg(FRAG_ATTRIB_WPOS, 2)));
+   if (intel->gen >= 6) {
+      emit(fs_inst(BRW_OPCODE_MOV, wpos,
+		   fs_reg(brw_vec8_grf(c->source_depth_reg, 0))));
+   } else {
+      emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y,
+		   interp_reg(FRAG_ATTRIB_WPOS, 2)));
+   }
    wpos.reg_offset++;
 
    /* gl_FragCoord.w: Already set up in emit_interpolation */




More information about the mesa-commit mailing list