gallium: fix state tracker's stencil buffer test
authorBrian Paul <brianp@vmware.com>
Fri, 27 Feb 2009 16:45:41 +0000 (09:45 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 27 Feb 2009 17:08:46 +0000 (10:08 -0700)
Need to check ctx->DrawBuffer->Visual.stencilBits not ctx->Visual.stencilBits
because the later only applies to the window system buffers, not user-created
FBOs.

This, plus the previous commit, fixes progs/tests/fbotexture.c

src/mesa/state_tracker/st_atom_depth.c

index a6156df7ae00e6e3e276f231c3da05567fade3cb..4ea62dda18430680af869c980d3ba27c79aa7e2b 100644 (file)
@@ -106,7 +106,7 @@ update_depth_stencil_alpha(struct st_context *st)
        ctx->Query.CurrentOcclusionObject->Active)
       dsa->depth.occlusion_count = 1;
 
-   if (ctx->Stencil.Enabled && ctx->Visual.stencilBits > 0) {
+   if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) {
       dsa->stencil[0].enabled = 1;
       dsa->stencil[0].func = st_compare_func_to_pipe(ctx->Stencil.Function[0]);
       dsa->stencil[0].fail_op = gl_stencil_op_to_pipe(ctx->Stencil.FailFunc[0]);