st/mesa: Only enable depth writes if the function isn't EQUAL.
[mesa.git] / src / mesa / state_tracker / st_atom_depth.c
index 6ddb8f525cf4445541ef033d6118a15af0cf9737..9e12361f881903b19877c6e7fe0d2fed4b12d81a 100644 (file)
@@ -107,8 +107,9 @@ st_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;