[Mesa-dev] [PATCH v2 6/6] mesa: Make a function is_transform_feedback_active_and_unpaused.
Ian Romanick
ian.d.romanick at intel.com
Mon Dec 17 10:49:37 PST 2012
On 12/16/2012 07:49 AM, Brian Paul wrote:
> 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.
Yeah, I like both those suggestions.
I had also been thinking of 'really_active' instead of
'active_and_unpaused'. _mesa_is_xfb_really_active() doesn't seem to
lose and clarity from _mesa_is_xfb_active_and_unpaused(). I'm not too
hung up on it, though. *shrug*
> Reviewed-by: Brian Paul <brianp at vmware.com>
With Brian's suggestions incorporated, it's
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
More information about the mesa-dev
mailing list