<div dir="ltr">On Mon, Mar 27, 2017 at 12:43 PM, Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br>><br>><br>> On 27/03/17 20:30, Grazvydas Ignotas wrote:<br>>><br>>> On Mon, Mar 27, 2017 at 6:14 AM, Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>><br>>> wrote:<br>>>><br>>>> Due to a max limit of 65,536 entries on the index table that we use to<br>>>> decide if we can skip compiling individual shaders, it is very likely<br>>>> we will have collisions.<br>>>><br>>>> To avoid doing too much work when the linked program may be in the<br>>>> cache this patch delays calling the optimisations until link time.<br>>>><br>>>> Improves cold cache start-up times on Deus Ex by ~20 seconds.<br>>>><br>>>> When deleting the cache index to simulate a worst case scenario<br>>>> of colisions in the index, warm cache start-up time improve by<br>>><br>>><br>>> typo: collisions<br>>><br>>>> ~45 seconds.<br>>><br>>><br>>> I wonder if it won't make the experience worse in some cases. For<br>>> example Talos compiles all the shaders on the loading screen, and then<br>>> seems to link them ingame during gameplay, so if too much work is<br>>> delayed to link time, on cold cache there might be faster loading<br>>> times but ingame stalls will be much worse than they currently are.<br>>> That needs more testing though, I'll try to do some in the evening.<br>><br>><br>> Yeah I thought about that, but usually games that do that don't link all the<br>> shaders at run time just some of them, and since shaders are often linked<br>> into different programs, and we can detect and skip shaders that have been<br>> compiled before we shouldn't hit too many that need to be optimised.<br>><br>> And as always with shader cache the pain is only on the first run and then<br>> its all positives for each run after that.<br>><br>> That said any testing would be great, I'm fairly confident the impact should<br>> be minimal. I'll send a v2 of the series out shortly with some fixes.<br><br>As promised, I've ran some games and all looks good, with subjective load-a-level-on-cold-cache I haven't noticed any difference between before and after the series. I've noted down some loading times, *_lvl ones load some level from the main menu I have saves in that game, the remaining ones are game startup times:<br><br><span style="font-family:monospace,monospace">               before    after<br>               cold hot  cold hot<br>DeusExMDbench: 285  34   261  27<br>Talos:         20   20   18   17<br>L4D2_lvl:      19   19   19   18<br>AlienIsl:      27   18   24   17<br>AlienIsl_lvl:  47   26   43   23<br>SOMA:          14   14   14   14<br>SOMA_lvl:      13   13   13   13<br>TombR_lvl:      7    5   7    5</span><br><br>As I don't feel like I know the code enough to fully understand the changes, the series gets my<br>Tested-by: Grazvydas Ignotas <<a href="mailto:notasas@gmail.com">notasas@gmail.com</a>><br><br><br></div>