X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_atom_depth.c;h=9e12361f881903b19877c6e7fe0d2fed4b12d81a;hb=42d31e0516d64bca45a45f73e6a2f7f40e6daa4b;hp=7092c3f83ec9d0868b67194645e5d2648695b930;hpb=54f8efeb022de8686db18c49daf14e6771f0fda1;p=mesa.git diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index 7092c3f83ec..9e12361f881 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -41,7 +41,6 @@ #include "pipe/p_defines.h" #include "cso_cache/cso_context.h" -#include "main/core.h" #include "main/stencil.h" @@ -95,8 +94,8 @@ gl_stencil_op_to_pipe(GLenum func) } } -static void -update_depth_stencil_alpha(struct st_context *st) +void +st_update_depth_stencil_alpha(struct st_context *st) { struct pipe_depth_stencil_alpha_state *dsa = &st->state.depth_stencil; struct pipe_stencil_ref sr; @@ -108,8 +107,9 @@ update_depth_stencil_alpha(struct st_context *st) if (ctx->DrawBuffer->Visual.depthBits > 0) { if (ctx->Depth.Test) { dsa->depth.enabled = 1; - dsa->depth.writemask = ctx->Depth.Mask; dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func); + if (dsa->depth.func != PIPE_FUNC_EQUAL) + dsa->depth.writemask = ctx->Depth.Mask; } if (ctx->Depth.BoundsTest) { dsa->depth.bounds_test = 1; @@ -128,7 +128,7 @@ update_depth_stencil_alpha(struct st_context *st) dsa->stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff; sr.ref_value[0] = _mesa_get_stencil_ref(ctx, 0); - if (ctx->Stencil._TestTwoSide) { + if (_mesa_stencil_is_two_sided(ctx)) { const GLuint back = ctx->Stencil._BackFace; dsa->stencil[1].enabled = 1; dsa->stencil[1].func = st_compare_func_to_pipe(ctx->Stencil.Function[back]); @@ -159,8 +159,3 @@ update_depth_stencil_alpha(struct st_context *st) cso_set_depth_stencil_alpha(st->cso_context, dsa); cso_set_stencil_ref(st->cso_context, &sr); } - - -const struct st_tracked_state st_update_depth_stencil_alpha = { - update_depth_stencil_alpha /* update */ -};