[Mesa-dev] [PATCH 1/8] meta: Put _mesa_meta_in_progress in the header file

Ian Romanick idr at freedesktop.org
Sun Dec 21 11:30:02 PST 2014


On 12/19/2014 06:10 PM, Matt Turner wrote:
> On Fri, Dec 19, 2014 at 2:20 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> ...so that it can be inlined in the two places that call it.
> 
>    if (brw->meta_in_progress != _mesa_meta_in_progress(ctx)) {
>       brw->meta_in_progress = _mesa_meta_in_progress(ctx);
>       brw->state.dirty.brw |= BRW_NEW_META_IN_PROGRESS;
>    }
> 
> I suspect the compiler wasn't able to deduce that
> _mesa_meta_in_progress() was a pure function, so it actually called it
> twice. Inlining it obviously gives it that information.

The other problem is that one of the callers was in a different file, so
it would never be inlined there.  Of course, that callsite was never
executed in my testing.

> Reviewed-by: Matt Turner <mattst88 at gmail.com>



More information about the mesa-dev mailing list