swrast: add check for conditional rendering
authorBrian Paul <brianp@vmware.com>
Thu, 31 Dec 2009 04:40:12 +0000 (21:40 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 31 Dec 2009 15:49:27 +0000 (08:49 -0700)
src/mesa/swrast/s_bitmap.c
src/mesa/swrast/s_blit.c
src/mesa/swrast/s_clear.c
src/mesa/swrast/s_copypix.c
src/mesa/swrast/s_drawpix.c

index 3dbdf2a61a88ea8011838bb170e3e009aea66d0b..46c63aa6458e36256ff8bd41a63d43a53bd301f2 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "main/glheader.h"
 #include "main/bufferobj.h"
+#include "main/condrender.h"
 #include "main/image.h"
 #include "main/macros.h"
 #include "main/pixel.h"
@@ -56,6 +57,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
 
    ASSERT(ctx->RenderMode == GL_RENDER);
 
+   if (!_mesa_check_conditional_render(ctx))
+      return; /* don't draw */
+
    bitmap = (const GLubyte *) _mesa_map_pbo_source(ctx, unpack, bitmap);
    if (!bitmap)
       return;
index 8303e4debc75dcb5b15c18543f40232c4e2e04c3..f73ac78ae26d6c67ba1745a3f3cac2348b05ab1a 100644 (file)
@@ -24,6 +24,7 @@
 
 
 #include "main/glheader.h"
+#include "main/condrender.h"
 #include "main/image.h"
 #include "main/macros.h"
 #include "s_context.h"
@@ -567,6 +568,9 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
    };
    GLint i;
 
+   if (!_mesa_check_conditional_render(ctx))
+      return; /* don't clear */
+
    if (!ctx->DrawBuffer->_NumColorDrawBuffers)
       return;
 
index 2d27797d43542fb3da88ae86c74f2d84efc1e533..21167a64b3dad8eca6cf7b923cb5928cfe2f575b 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "main/glheader.h"
 #include "main/colormac.h"
+#include "main/condrender.h"
 #include "main/formats.h"
 #include "main/macros.h"
 #include "main/imports.h"
@@ -300,6 +301,9 @@ _swrast_Clear(GLcontext *ctx, GLbitfield buffers)
    }
 #endif
 
+   if (!_mesa_check_conditional_render(ctx))
+      return; /* don't clear */
+
    swrast_render_start(ctx);
 
    /* do software clearing here */
index 5ecfb1e90a97bd0116855c7653dc5b938f982e97..986b6aff4f081d0bd2764e6e8308a3f1dd4bd4d8 100644 (file)
@@ -26,6 +26,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/colormac.h"
+#include "main/condrender.h"
 #include "main/convolve.h"
 #include "main/histogram.h"
 #include "main/image.h"
@@ -901,6 +902,9 @@ _swrast_CopyPixels( GLcontext *ctx,
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    swrast_render_start(ctx);
       
+   if (!_mesa_check_conditional_render(ctx))
+      return; /* don't copy */
+
    if (swrast->NewState)
       _swrast_validate_derived( ctx );
 
index 6970b2e9cb522ae2f4c05fbba373a674a07dabf3..55a4c4c3c610615041a4b75d784f44e22a8a96e5 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "main/glheader.h"
 #include "main/bufferobj.h"
+#include "main/condrender.h"
 #include "main/context.h"
 #include "main/convolve.h"
 #include "main/image.h"
@@ -831,6 +832,9 @@ _swrast_DrawPixels( GLcontext *ctx,
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    GLboolean save_vp_override = ctx->VertexProgram._Overriden;
 
+   if (!_mesa_check_conditional_render(ctx))
+      return; /* don't draw */
+
    /* We are creating fragments directly, without going through vertex
     * programs.
     *