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|
|radeonsi||cache disabled||uncached||cached||cache size|
|NIR before||103||135||60||32 MB|
|NIR after||102||130||2.81||33 MB|