From ab26682eb4db0dbe160b13f1e320ec9164c3afc5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 21:40:12 -0700 Subject: [PATCH] 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(+) diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 3dbdf2a61a8..46c63aa6458 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 8303e4debc7..f73ac78ae26 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 2d27797d435..21167a64b3d 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 5ecfb1e90a9..986b6aff4f0 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 6970b2e9cb5..55a4c4c3c61 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. * -- 2.30.2