Mesa (gallium-mesa-7.4): gallium: fix state tracker's stencil buffer test

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 27 17:41:03 UTC 2009


Module: Mesa
Branch: gallium-mesa-7.4
Commit: dc0f1434a9b8f716b669c69aa1139324eeec1915
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc0f1434a9b8f716b669c69aa1139324eeec1915

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Feb 27 10:38:47 2009 -0700

gallium: fix state tracker's stencil buffer test

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

(cherry picked from master, commit 026465b9b1aebab98b6d519b75fe96d0ca9f4f51)

---

 src/mesa/state_tracker/st_atom_depth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c
index 2d617bd..b98d881 100644
--- a/src/mesa/state_tracker/st_atom_depth.c
+++ b/src/mesa/state_tracker/st_atom_depth.c
@@ -105,7 +105,7 @@ update_depth_stencil_alpha(struct st_context *st)
        st->ctx->Query.CurrentOcclusionObject->Active)
       dsa->depth.occlusion_count = 1;
 
-   if (st->ctx->Stencil.Enabled && st->ctx->Visual.stencilBits > 0) {
+   if (st->ctx->Stencil.Enabled && st->ctx->DrawBuffer->Visual.stencilBits > 0) {
       dsa->stencil[0].enabled = 1;
       dsa->stencil[0].func = st_compare_func_to_pipe(st->ctx->Stencil.Function[0]);
       dsa->stencil[0].fail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.FailFunc[0]);




More information about the mesa-commit mailing list