[Mesa-dev] [PATCH 0/3] Minor fixed-function fragment shader cache key optimizations.

Gustaw Smolarczyk wielkiegie at gmail.com
Mon Mar 27 22:16:56 UTC 2017


2017-03-27 21:27 GMT+02:00 Gustaw Smolarczyk <wielkiegie at gmail.com>:
> 2017-03-27 21:10 GMT+02:00 Jason Ekstrand <jason at jlekstrand.net>:
>> On March 27, 2017 10:24:47 AM Gustaw Smolarczyk <wielkiegie at gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I was playing with profiling Minecraft on radeonsi in perf and found that
>>> _mesa_get_fixed_func_fragment_program was a little bit too high in the
>>> profile
>>> log than it should. I assumed that most of it comes from make_state_key
>>> static
>>> function which I am trying to optimize now in the spare time.
>>>
>>> I started with a few pretty simple things. I don't think they will help
>>> much,
>>> but should be a good start.
>>
>>
>> Do you have any performance data for any of this?  It looks reasonable to me
>> but I'm not very familiar with this code.  I just know that others will ask.
>> :-)
>
> Unfortunately not. Testing minecraft is not an easy task since it's
> not simple to reproduce the same testing circumstances.
>
> Maybe I should record an apitrace trace and try to profile that? I
> will try that later, though I don't expect much of a difference with
> these patches - there are probably other things that could be done to
> make_state_key that would have more of a performance impact.

I have created a simple (~1min) apitrace trace of minecraft. I
measured the produced FPS using apitrace replay -b and at the same
time I profiled the apitrace using perf and looked at % spent in
_mesa_get_fixed_func_fragment_program. The results show that these 3
patches help only very slightly or even not at all (a.k.a. "a wash").

It seems that I also overestimated the time spent in the optimized
function (it's less than 1%), though it's still one of the hottest
mesa functions in the profile.

5 runs before and after the patches.

Before:
FPS: 65.12666 +/- 0.25995
_mesa_get_fixed_func_fragment_program: 0.734% +/- 0.023323

After:
FPS: 65.52748 +/- 0.53377
_mesa_get_fixed_func_fragment_program: 0.728% +/- 0.011661

Gustaw


More information about the mesa-dev mailing list