st/mesa: fix bug in depthstencil optimizing clear logic
authorRoland Scheidegger <sroland@vmware.com>
Sat, 5 Jun 2010 14:44:31 +0000 (16:44 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 5 Jun 2010 14:54:36 +0000 (16:54 +0200)
src/mesa/state_tracker/st_cb_clear.c

index a819d305303b6cf5cc83b0545c28220d2e3ea3d0..b15792504af8b8c66389fef00fd6552382346937 100644 (file)
@@ -540,7 +540,8 @@ st_Clear(GLcontext *ctx, GLbitfield mask)
        * required from the visual. Hence fix this up to avoid potential
        * read-modify-write in the driver.
        */
-      if (((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &&
+      if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
+          ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &&
           (depthRb == stencilRb) &&
           (ctx->DrawBuffer->Visual.depthBits == 0 ||
            ctx->DrawBuffer->Visual.stencilBits == 0))