diff options
author | Maciej Cencora <[email protected]> | 2009-02-17 13:30:33 +0100 |
---|---|---|
committer | Nicolai Haehnle <[email protected]> | 2009-03-06 22:19:44 +0100 |
commit | 99e4809f5d2126db36ec652e07bc8e77f1383a84 (patch) | |
tree | c9d2207c51e890408cda1fca6b7c3a0aeadc0930 /src | |
parent | 0828bfaa4534615e29284c95df7435883dbeb735 (diff) |
r300: fix depth write regression (found by Nicolai Haehnle)
Signed-off-by: Nicolai Haehnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 8361afafef3..8095538ff94 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2234,7 +2234,7 @@ static void r300ResetHwState(r300ContextPtr r300) /* disable fog unit */ r300->hw.fogs.cmd[R300_FOGS_STATE] = 0; - r300->hw.fg_depth_src.cmd[1] = R300_FG_DEPTH_SRC_SHADER; + r300->hw.fg_depth_src.cmd[1] = R300_FG_DEPTH_SRC_SCAN; r300->hw.rb3d_cctl.cmd[1] = 0; @@ -2539,18 +2539,25 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) /* w_fmt value is set to get best performance * see p.130 R5xx 3D acceleration guide v1.3 */ - GLuint w_fmt; + GLuint w_fmt, fgdepthsrc; if (current_fragment_program_writes_depth(ctx)) { + fgdepthsrc = R300_FG_DEPTH_SRC_SHADER; w_fmt = R300_W_FMT_W24 | R300_W_SRC_US; } else { + fgdepthsrc = R300_FG_DEPTH_SRC_SCAN; w_fmt = R300_W_FMT_W0 | R300_W_SRC_US; } - + if (w_fmt != rmesa->hw.us_out_fmt.cmd[5]) { R300_STATECHANGE(rmesa, us_out_fmt); rmesa->hw.us_out_fmt.cmd[5] = w_fmt; } + if (fgdepthsrc != rmesa->hw.fg_depth_src.cmd[1]) { + R300_STATECHANGE(rmesa, fg_depth_src); + rmesa->hw.fg_depth_src.cmd[1] = fgdepthsrc; + } + if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) r500SetupPixelShader(rmesa); else |