Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / state_tracker / st_cb_clear.c
index a819d305303b6cf5cc83b0545c28220d2e3ea3d0..bd1dd78b23c8c54fe2ffda174188fd803f1201d7 100644 (file)
@@ -36,7 +36,7 @@
 #include "main/glheader.h"
 #include "main/formats.h"
 #include "main/macros.h"
-#include "shader/prog_instruction.h"
+#include "program/prog_instruction.h"
 #include "st_context.h"
 #include "st_atom.h"
 #include "st_cb_accum.h"
@@ -45,6 +45,7 @@
 #include "st_program.h"
 
 #include "pipe/p_context.h"
+#include "pipe/p_shader_tokens.h"
 #include "pipe/p_state.h"
 #include "pipe/p_defines.h"
 #include "util/u_format.h"
@@ -190,7 +191,7 @@ draw_quad(struct st_context *st,
  * ctx->DrawBuffer->_X/Ymin/max fields.
  */
 static void
-clear_with_quad(GLcontext *ctx,
+clear_with_quad(struct gl_context *ctx,
                 GLboolean color, GLboolean depth, GLboolean stencil)
 {
    struct st_context *st = st_context(ctx);
@@ -315,7 +316,7 @@ clear_with_quad(GLcontext *ctx,
  * Determine if we need to clear the depth buffer by drawing a quad.
  */
 static INLINE GLboolean
-check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
+check_clear_color_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb)
 {
    if (ctx->Scissor.Enabled &&
        (ctx->Scissor.X != 0 ||
@@ -339,7 +340,7 @@ check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
  * drawing a quad.
  */
 static INLINE GLboolean
-check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
+check_clear_depth_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb)
 {
    const GLuint stencilMax = 0xff;
    GLboolean maskStencil
@@ -367,7 +368,7 @@ check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
  * Determine if we need to clear the depth buffer by drawing a quad.
  */
 static INLINE GLboolean
-check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb,
+check_clear_depth_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb,
                             boolean ds_separate)
 {
    const struct st_renderbuffer *strb = st_renderbuffer(rb);
@@ -391,7 +392,7 @@ check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb,
  * Determine if we need to clear the stencil buffer by drawing a quad.
  */
 static INLINE GLboolean
-check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb,
+check_clear_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb,
                               boolean ds_separate)
 {
    const struct st_renderbuffer *strb = st_renderbuffer(rb);
@@ -446,7 +447,7 @@ st_flush_clear(struct st_context *st)
  * Called via ctx->Driver.Clear()
  */
 static void
-st_Clear(GLcontext *ctx, GLbitfield mask)
+st_Clear(struct gl_context *ctx, GLbitfield mask)
 {
    static const GLbitfield BUFFER_BITS_DS
       = (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
@@ -540,7 +541,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))