SnowflakePowered / librashader

RetroArch Shaders for All
Mozilla Public License 2.0
77 stars 7 forks source link

Transparent shader cache #10

Closed chyyran closed 1 year ago

chyyran commented 1 year ago

Transparent global caching for compiled shader/PSO objects for

Transparent here means that the cache must be completely fallible. If any step in the retrieval of cached objects goes wrong, it must not fail and must re-try with a non-cached instance. Runtimes are not given an opportunity to recover from a cache fail, it will just failover with the non-cached instance.

The cache is implemented via SQLite with WAL2 because we need to be resilient across multiple processes that could have librashader loaded. Cache data is updated on a best effort basis. If cached pipelines become outdated because of driver updates, they are automatically invalidated and replaced with new pipelines.

This is exposed in the C API without an API version bump, making it another breaking ABI change before 0.1.0. Guess the rc.3 promise was a lie. Hopefully this will be the last.