[Mesa-dev] [PATCH 1/3] glsl: delay optimisations on individual shaders when cache is available

Timothy Arceri tarceri at itsqueeze.com
Mon Mar 27 09:43:40 UTC 2017



On 27/03/17 20:30, Grazvydas Ignotas wrote:
> On Mon, Mar 27, 2017 at 6:14 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
>> Due to a max limit of 65,536 entries on the index table that we use to
>> decide if we can skip compiling individual shaders, it is very likely
>> we will have collisions.
>>
>> To avoid doing too much work when the linked program may be in the
>> cache this patch delays calling the optimisations until link time.
>>
>> Improves cold cache start-up times on Deus Ex by ~20 seconds.
>>
>> When deleting the cache index to simulate a worst case scenario
>> of colisions in the index, warm cache start-up time improve by
>
> typo: collisions
>
>> ~45 seconds.
>
> I wonder if it won't make the experience worse in some cases. For
> example Talos compiles all the shaders on the loading screen, and then
> seems to link them ingame during gameplay, so if too much work is
> delayed to link time, on cold cache there might be faster loading
> times but ingame stalls will be much worse than they currently are.
> That needs more testing though, I'll try to do some in the evening.

Yeah I thought about that, but usually games that do that don't link all 
the shaders at run time just some of them, and since shaders are often 
linked into different programs, and we can detect and skip shaders that 
have been compiled before we shouldn't hit too many that need to be 
optimised.

And as always with shader cache the pain is only on the first run and 
then its all positives for each run after that.

That said any testing would be great, I'm fairly confident the impact 
should be minimal. I'll send a v2 of the series out shortly with some fixes.

>
> GraÅžvydas
>


More information about the mesa-dev mailing list