diff options
author | Nicolai Haehnle <[email protected]> | 2007-03-19 19:45:45 +0100 |
---|---|---|
committer | Nicolai Haehnle <[email protected]> | 2007-03-19 19:48:58 +0100 |
commit | c4bf863f4cb48c2de284933bb1fc725b540ee810 (patch) | |
tree | 9af7aa5cfa36293b8736e266a8507196072c0219 /src | |
parent | b645e8c96dc1e3b153cf882c8931f10e0c006f04 (diff) |
r300: Fix WRITEMASK handling when writing to result.depth
This is a necessary change to emit the right instructions when writing
to result.depth.
However, even with this test, Z-write doesn't work properly, and I don't
fully understand why. In addition to this, we'll at least have to disable
early-Z, but even that doesn't seem to be enough.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_fragprog.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index b0681e28083..fb559e880ae 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -1304,9 +1304,14 @@ static void emit_arith(struct r300_fragment_program *rp, argc = r300_fpop[op].argc; if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT && - REG_GET_INDEX(dest) == FRAG_RESULT_DEPR) - mask &= ~WRITEMASK_XYZ; - + REG_GET_INDEX(dest) == FRAG_RESULT_DEPR) { + if (mask & WRITEMASK_Z) { + mask = WRITEMASK_W; + } else { + return; + } + } + emit_vop = GL_FALSE; emit_sop = GL_FALSE; if ((mask & WRITEMASK_XYZ) || vop == R300_FPI0_OUTC_DP3) |