Merge branch 'master' into pipe-format-simplify
[mesa.git] / src / mesa / state_tracker / st_atom_depth.c
index a6156df7ae00e6e3e276f231c3da05567fade3cb..88b80a07fc98402fd89a6c7022eb7995ecb6910c 100644 (file)
@@ -98,15 +98,13 @@ update_depth_stencil_alpha(struct st_context *st)
 
    memset(dsa, 0, sizeof(*dsa));
 
-   dsa->depth.enabled = ctx->Depth.Test;
-   dsa->depth.writemask = ctx->Depth.Mask;
-   dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func);
-
-   if (ctx->Query.CurrentOcclusionObject &&
-       ctx->Query.CurrentOcclusionObject->Active)
-      dsa->depth.occlusion_count = 1;
+   if (ctx->Depth.Test && ctx->DrawBuffer->Visual.depthBits > 0) {
+      dsa->depth.enabled = 1;
+      dsa->depth.writemask = ctx->Depth.Mask;
+      dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func);
+   }
 
-   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]);