[Mesa-dev] [PATCH v2 6/6] mesa: Make a function is_transform_feedback_active_and_unpaused.

Brian Paul brian.e.paul at gmail.com
Sun Dec 16 07:49:21 PST 2012


On Sat, Dec 15, 2012 at 11:09 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> 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.
>


> @@ -111,4 +113,11 @@ _mesa_PauseTransformFeedback(void);
>  extern void GLAPIENTRY
>  _mesa_ResumeTransformFeedback(void);
>
> +static inline bool
> +is_transform_feedback_active_and_unpaused(struct gl_context *ctx)
> +{
> +   return ctx->TransformFeedback.CurrentObject->Active &&
> +      !ctx->TransformFeedback.CurrentObject->Paused;
> +}

Non-private core Mesa functions should have the _mesa_ prefix.  It's a
long name already.  Maybe use the "xfb" abbreviation?

The ctx parameter could be const-qualified.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list