Mesa (master): swrast: add check for conditional rendering

Brian Paul brianp at kemper.freedesktop.org
Thu Dec 31 07:54:56 PST 2009


Module: Mesa
Branch: master
Commit: ab26682eb4db0dbe160b13f1e320ec9164c3afc5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab26682eb4db0dbe160b13f1e320ec9164c3afc5

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Dec 30 21:40:12 2009 -0700

swrast: add check for conditional rendering

---

 src/mesa/swrast/s_bitmap.c  |    4 ++++
 src/mesa/swrast/s_blit.c    |    4 ++++
 src/mesa/swrast/s_clear.c   |    4 ++++
 src/mesa/swrast/s_copypix.c |    4 ++++
 src/mesa/swrast/s_drawpix.c |    4 ++++
 5 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index 3dbdf2a..46c63aa 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -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;
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index 8303e4d..f73ac78 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -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;
 
diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c
index 2d27797..21167a6 100644
--- a/src/mesa/swrast/s_clear.c
+++ b/src/mesa/swrast/s_clear.c
@@ -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 */
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 5ecfb1e..986b6af 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -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 );
 
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 6970b2e..55a4c4c 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -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.
     *



More information about the mesa-commit mailing list