gallium, nir, radeonsi: run driver-specific optimizations in st/mesa before shader caching (v3)
This increases the efficiency of the shader cache, because shaders are cached by st/mesa after they are optimized by drivers. This is enabled by the new callback pipe_screen::finalize_nir
, which is optional and can be NULL.
The shader cache is fixed in !2442 (merged), so now we always get 100% cache hits after the first run.
The tested shaders are from Borderlands 2.
noop driver | cache disabled | uncached | cached | cache size | |
---|---|---|---|---|---|
NIR before | 38.8 | 55.0 | 1.86 | 16 MB | |
NIR after | 38.8 | 60.2 | 1.79 | 18 MB | |
TGSI | 13.9 | 17.7 | 0.65 | 11 MB |
radeonsi | cache disabled | uncached | cached | cache size | |
---|---|---|---|---|---|
NIR before | 103 | 135 | 60 | 32 MB | |
NIR after | 102 | 130 | 2.81 | 33 MB | |
TGSI | 66 | 76 | 1.05 | 25 MB |