summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-04-20 00:21:01 -0700
committerEric Anholt <[email protected]>2011-04-23 13:14:56 -0700
commitfb60040b691c174c1bfffb46cb6c39bbae6f27c5 (patch)
tree951c675adaca2cc4af1a632f8998605817205db7 /src/mesa/drivers/common/meta.c
parent4093fdce6d7b8370bfe3ff5119dc0ef0acb32054 (diff)
meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.
The NV_conditional_render spec calls out specific operations that conditional rendering applies to, which doesn't include these. Fixes NV_conditional_render/generatemipmap on swrast. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 6c35fa10d8a..a3964798b14 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -40,6 +40,7 @@
#include "main/bufferobj.h"
#include "main/buffers.h"
#include "main/colortab.h"
+#include "main/condrender.h"
#include "main/depth.h"
#include "main/enable.h"
#include "main/fbobject.h"
@@ -94,6 +95,7 @@
#define META_VIEWPORT 0x4000
#define META_CLAMP_FRAGMENT_COLOR 0x8000
#define META_CLAMP_VERTEX_COLOR 0x10000
+#define META_CONDITIONAL_RENDER 0x20000
/*@}*/
@@ -188,6 +190,10 @@ struct save_state
/** META_CLAMP_VERTEX_COLOR */
GLenum ClampVertexColor;
+ /** META_CONDITIONAL_RENDER */
+ struct gl_query_object *CondRenderQuery;
+ GLenum CondRenderMode;
+
/** Miscellaneous (always disabled) */
GLboolean Lighting;
};
@@ -597,6 +603,14 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR, GL_FALSE);
}
+ if (state & META_CONDITIONAL_RENDER) {
+ save->CondRenderQuery = ctx->Query.CondRenderQuery;
+ save->CondRenderMode = ctx->Query.CondRenderMode;
+
+ if (ctx->Query.CondRenderQuery)
+ _mesa_EndConditionalRender();
+ }
+
/* misc */
{
save->Lighting = ctx->Light.Enabled;
@@ -869,6 +883,12 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR, save->ClampVertexColor);
}
+ if (state & META_CONDITIONAL_RENDER) {
+ if (save->CondRenderQuery)
+ _mesa_BeginConditionalRender(save->CondRenderQuery->Id,
+ save->CondRenderMode);
+ }
+
/* misc */
if (save->Lighting) {
_mesa_set_enable(ctx, GL_LIGHTING, GL_TRUE);
@@ -1442,7 +1462,10 @@ _mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers)
};
struct vertex verts[4];
/* save all state but scissor, pixel pack/unpack */
- GLbitfield metaSave = META_ALL - META_SCISSOR - META_PIXEL_STORE;
+ GLbitfield metaSave = (META_ALL -
+ META_SCISSOR -
+ META_PIXEL_STORE -
+ META_CONDITIONAL_RENDER);
const GLuint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
if (buffers & BUFFER_BITS_COLOR) {