summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/transformfeedback.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-12-15 14:21:32 -0800
committerPaul Berry <[email protected]>2012-12-18 09:02:53 -0800
commit5b7099c74d7774dc59895536bad53bd1196e398c (patch)
tree5571409df894f68003491baa6f6476161ec898b7 /src/mesa/main/transformfeedback.h
parent1ad516207d2297b14fe26627e5bb599a9f704ac5 (diff)
mesa: Make a function is_transform_feedback_active_and_unpaused.
The rather unweildy logic for determining this condition was repeated in a large number of places. This patch consolidates it to a single inline function. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/transformfeedback.h')
-rw-r--r--src/mesa/main/transformfeedback.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h
index 3c03b7a2413..c128746b3ef 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -25,9 +25,11 @@
#ifndef TRANSFORM_FEEDBACK_H
#define TRANSFORM_FEEDBACK_H
+#include <stdbool.h>
#include "compiler.h"
#include "glheader.h"
#include "mfeatures.h"
+#include "mtypes.h"
struct _glapi_table;
struct dd_function_table;
@@ -111,4 +113,11 @@ _mesa_PauseTransformFeedback(void);
extern void GLAPIENTRY
_mesa_ResumeTransformFeedback(void);
+static inline bool
+_mesa_is_xfb_active_and_unpaused(const struct gl_context *ctx)
+{
+ return ctx->TransformFeedback.CurrentObject->Active &&
+ !ctx->TransformFeedback.CurrentObject->Paused;
+}
+
#endif /* TRANSFORM_FEEDBACK_H */