From: Maciej Cencora Date: Wed, 10 Mar 2010 21:28:53 +0000 (+0100) Subject: r300: enable depth test only if depth buffer is available X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=addedd091e81907837b3aa0680b242b8fdbde7ef;p=mesa.git r300: enable depth test only if depth buffer is available Fixes #23532 and piglit/fbo-nodepth-test piglit/fbo-nostencil-test --- diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 87489412419..e75c88e101b 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -590,7 +590,7 @@ static void r300SetDepthState(GLcontext * ctx) R500_STENCIL_REFMASK_FRONT_BACK); r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_Z_FUNC_SHIFT); - if (ctx->Depth.Test) { + if (ctx->Depth.Test && ctx->DrawBuffer->_DepthBuffer) { r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_Z_ENABLE; if (ctx->Depth.Mask) r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_Z_WRITE_ENABLE;