From 163611d7b21670de6074c09d37bdf93bad494036 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Mon, 19 Dec 2011 14:28:32 -0800 Subject: [PATCH] mesa: Add a function to query whether a meta-op is in progress. This is needed by i965 to ensure that transform feedback counters are not incremented during meta-ops. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/common/meta.c | 10 ++++++++++ src/mesa/drivers/common/meta.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 1683c85e9b7..c5c59ebeec9 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -984,6 +984,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 diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index 71981398492..d13796ebed0 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -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, -- 2.30.2