From: Owen W. Taylor Date: Thu, 7 May 2009 02:45:33 +0000 (-0400) Subject: Call _mesa_update_stencil() before accessing ctx->Stencil._Enabled X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34eab5dd9c837769f1259e1f900b4528586d23b2;p=mesa.git 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 --- diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index decea4518e6..2f55dadcb98 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 {