Mesa (radeon-rewrite): Call _mesa_update_stencil() before accessing ctx-> Stencil._Enabled

Alex Deucher agd5f at kemper.freedesktop.org
Wed May 13 23:44:32 UTC 2009


Module: Mesa
Branch: radeon-rewrite
Commit: 34eab5dd9c837769f1259e1f900b4528586d23b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34eab5dd9c837769f1259e1f900b4528586d23b2

Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Wed May  6 22:45:33 2009 -0400

Call _mesa_update_stencil() before accessing ctx->Stencil._Enabled

ctx->Stencil._Enabled is derived state and not immediately updated
when the stencil parameters are changed; we need to make sure that
it is up-to-date before accessing it.

https://bugs.freedesktop.org/show_bug.cgi?id=21608

---

 src/mesa/drivers/dri/radeon/radeon_common.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index decea45..2f55dad 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -744,6 +744,8 @@ void radeon_draw_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
 	if (ctx->Driver.Enable) {
 		ctx->Driver.Enable(ctx, GL_DEPTH_TEST,
 				   (ctx->Depth.Test && fb->Visual.depthBits > 0));
+		/* Need to update the derived ctx->Stencil._Enabled first */
+		_mesa_update_stencil(ctx);
 		ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
 				   (ctx->Stencil._Enabled && fb->Visual.stencilBits > 0));
 	} else {




More information about the mesa-commit mailing list