mesa: Add a function to query whether a meta-op is in progress.
authorPaul Berry <stereotype441@gmail.com>
Mon, 19 Dec 2011 22:28:32 +0000 (14:28 -0800)
committerPaul Berry <stereotype441@gmail.com>
Tue, 20 Dec 2011 23:22:28 +0000 (15:22 -0800)
This is needed by i965 to ensure that transform feedback counters are
not incremented during meta-ops.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/common/meta.c
src/mesa/drivers/common/meta.h

index 1683c85..c5c59eb 100644 (file)
@@ -985,6 +985,16 @@ _mesa_meta_end(struct gl_context *ctx)
 
 
 /**
+ * Determine whether Mesa is currently in a meta state.
+ */
+GLboolean
+_mesa_meta_in_progress(struct gl_context *ctx)
+{
+   return ctx->Meta->SaveStackDepth != 0;
+}
+
+
+/**
  * Convert Z from a normalized value in the range [0, 1] to an object-space
  * Z coordinate in [-1, +1] so that drawing at the new Z position with the
  * default/identity ortho projection results in the original Z value.
index 7198139..d13796e 100644 (file)
@@ -69,6 +69,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state);
 extern void
 _mesa_meta_end(struct gl_context *ctx);
 
+extern GLboolean
+_mesa_meta_in_progress(struct gl_context *ctx);
+
 extern void
 _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
                            GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,