Mesa (master): r300: disable ZTOP only when occlusion queries are used

Maciej Cencora osiris at kemper.freedesktop.org
Sun Aug 16 00:13:51 UTC 2009


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

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Sun Aug 16 02:04:29 2009 +0200

r300: disable ZTOP only when occlusion queries are used

---

 src/mesa/drivers/dri/r300/r300_state.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index f39d746..6081c33 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -462,7 +462,7 @@ static GLboolean current_fragment_program_writes_depth(GLcontext* ctx)
 static void r300SetEarlyZState(GLcontext * ctx)
 {
 	r300ContextPtr r300 = R300_CONTEXT(ctx);
-	GLuint topZ = R300_ZTOP_DISABLE;
+	GLuint topZ = R300_ZTOP_ENABLE;
 	GLuint w_fmt, fgdepthsrc;
 
 	if (ctx->Color.AlphaEnabled && ctx->Color.AlphaFunc != GL_ALWAYS)
@@ -471,6 +471,8 @@ static void r300SetEarlyZState(GLcontext * ctx)
 		topZ = R300_ZTOP_DISABLE;
 	else if (ctx->FragmentProgram._Current && ctx->FragmentProgram._Current->UsesKill)
 		topZ = R300_ZTOP_DISABLE;
+	else if (r300->query.current)
+		topZ = R300_ZTOP_DISABLE;
 
 	if (topZ != r300->hw.zstencil_format.cmd[2]) {
 		/* Note: This completely reemits the stencil format.




More information about the mesa-commit mailing list