[Mesa-dev] unpack functions showing up highly in profiles

Brian Paul brian.e.paul at gmail.com
Sun Mar 18 07:13:21 PDT 2012

On Sat, Mar 17, 2012 at 7:55 PM, Matt Turner <mattst88 at gmail.com> wrote:
> Hey
> On my i965/SNB system I profiled some games in WINE and saw that some
> unpack_* functions in src/mesa/main/format_unpack.c show up very
> highly.
> In Day of Defeat: Source and Counter Strike: Source, the
> _mesa_unpack_uint_z_row function was 10~30%.
> In Starcraft II, the unpack_ARGB8888 function was 66%!
> I imagine we could optimize them by checking the value of 'n' and
> unrolling the loops if it's large enough, but I suspect the thing to
> do is figure out why they're being called so much to begin with and
> fix that. Any ideas?

Yes, let's try to find out why/where this function is getting called
from.  How about attaching a debugger to the process and setting a
breakpoint on those functions, then looking at the call stack?

> I'm also curious, in the case of unpack_ARGB8888 why does the (texture
> data?) have to be converted from byte integers to floats to begin
> with? Can't we use the integer data directly, or is this an
> inefficiency of WINE?

Getting the call stack should answer that question.


More information about the mesa-dev mailing list