Skip to content

st/nine: tgsi to nir disk cache

Axel Davy requested to merge axeldavy/mesa:tgsi_nir_nine_cache into master

tgsi to nir is slow. Let's cache it.

A trace of a Hat in Time, which builds thousands of shaders takes 339 seconds to run the second time without this patch, and 41 seconds with it (basically there is no more loading times).

This MR introduces the caching in gallium nine in a few lines. I guess some may ask that this cache be added to tgsi_to_nir instead.

Given the other tgsi users only have a few light shaders (gallium HUD, radeonsi's compute), I'm not convinced there is an interest to use a disk cache for them. Besides having the code reside in nine enables it to be a bit simpler as we don't have to handle the gl ability to replace the cache's put/get functions (radeonsi recomputes the sha1 and adds a crc32, which I guess is to handle badly written put/get).

Merge request reports