diff options
author | Chris Forbes <[email protected]> | 2013-10-05 21:39:25 +1300 |
---|---|---|
committer | Chris Forbes <[email protected]> | 2013-10-06 11:05:10 +1300 |
commit | 4697955c5bb9882ac9be4b70ac2a7d9f03c374d1 (patch) | |
tree | 819d6224006480a5adc065c2f1f5ca52ef9cfd30 | |
parent | 64b1a1d4594bd68b48f628d722123498621203af (diff) |
i965/wm: Program correct conservative depth modes
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_wm_state.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c index 80073cdf0e4..7ddeb6ec0a2 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c @@ -60,8 +60,20 @@ upload_wm_state(struct brw_context *brw) if (fp->program.Base.InputsRead & VARYING_BIT_POS) dw1 |= GEN7_WM_USES_SOURCE_DEPTH | GEN7_WM_USES_SOURCE_W; if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { - writes_depth = true; - dw1 |= GEN7_WM_PSCDEPTH_ON; + writes_depth = fp->program.FragDepthLayout != FRAG_DEPTH_LAYOUT_UNCHANGED; + + switch (fp->program.FragDepthLayout) { + case FRAG_DEPTH_LAYOUT_NONE: + case FRAG_DEPTH_LAYOUT_ANY: + dw1 |= GEN7_WM_PSCDEPTH_ON; + break; + case FRAG_DEPTH_LAYOUT_GREATER: + dw1 |= GEN7_WM_PSCDEPTH_ON_GE; + break; + case FRAG_DEPTH_LAYOUT_LESS: + dw1 |= GEN7_WM_PSCDEPTH_ON_LE; + break; + } } /* CACHE_NEW_WM_PROG */ dw1 |= brw->wm.prog_data->barycentric_interp_modes << |