[Mesa-dev] [PATCH 1/2] mesa: only look up base-format once

Matt Turner mattst88 at gmail.com
Fri Aug 28 12:08:03 PDT 2015


On Mon, Aug 24, 2015 at 2:02 PM, Erik Faye-Lund <kusmabite at gmail.com> wrote:
> There's no point in repeatedly looking up the base-format of an
> internalformat. So let's cache it in a variable instead.
>
> Signed-off-by: Erik Faye-Lund <kusmabite at gmail.com>
> ---

I actually measure an increase in .text size with this patch, but
marking the function with ATTRIBUTE_PURE seems to decrease .text size,
probably by accomplishing what you hoped with this patch.

I'd do that, and mark its gl_context *ctx argument const as well (and
remove the extra spaces inside the parentheses while you're at it).


More information about the mesa-dev mailing list