X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Fstate_tracker%2Fst_atom_depth.c;h=0e791ceb20873dfec2282c9caee42d29a69a458a;hb=b40ed6a0b54d1ba74799aeb3f529c4d298625aa1;hp=827ad3b548b83a23edea7624c64603fa53b938e1;hpb=03ec66375889f049b09f39ba98515aa35ac48164;p=mesa.git diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index 827ad3b548b..0e791ceb208 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) { + if (st->ctx->Stencil.Enabled && st->ctx->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]); @@ -115,7 +115,7 @@ update_depth_stencil_alpha(struct st_context *st) dsa->stencil[0].value_mask = st->ctx->Stencil.ValueMask[0] & 0xff; dsa->stencil[0].write_mask = st->ctx->Stencil.WriteMask[0] & 0xff; - if (st->ctx->Stencil.TestTwoSide) { + if (st->ctx->Stencil._TestTwoSide) { dsa->stencil[1].enabled = 1; dsa->stencil[1].func = st_compare_func_to_pipe(st->ctx->Stencil.Function[1]); dsa->stencil[1].fail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.FailFunc[1]); @@ -125,6 +125,10 @@ update_depth_stencil_alpha(struct st_context *st) dsa->stencil[1].value_mask = st->ctx->Stencil.ValueMask[1] & 0xff; dsa->stencil[1].write_mask = st->ctx->Stencil.WriteMask[1] & 0xff; } + else { + dsa->stencil[1] = dsa->stencil[0]; + dsa->stencil[1].enabled = 0; + } } if (st->ctx->Color.AlphaEnabled) { @@ -138,10 +142,10 @@ update_depth_stencil_alpha(struct st_context *st) const struct st_tracked_state st_update_depth_stencil_alpha = { - .name = "st_update_depth_stencil", - .dirty = { - .mesa = (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), - .st = 0, + "st_update_depth_stencil", /* name */ + { /* dirty */ + (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), /* mesa */ + 0, /* st */ }, - .update = update_depth_stencil_alpha + update_depth_stencil_alpha /* update */ };