Call _mesa_update_stencil() before accessing ctx->Stencil._Enabled
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 7 May 2009 02:45:33 +0000 (22:45 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 13 May 2009 23:02:51 +0000 (19:02 -0400)
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

index decea45..2f55dad 100644 (file)
@@ -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 {