protonscr

Can the cache be shared between games?

vkd3dclosed
HansKristian-Work/vkd3d-proton#2826 · opened 2026-02-16 by Tuupertunut · updated 2026-02-17 · 5 comments · github
TTuupertunut 2026-02-16 github

I'm running a nonstandard Proton setup where my games are located on a read-only drive, which means vkd3d cannot create the vkd3d-proton.cache files in the game directories. I'm planning to use the VKD3D_SHADER_CACHE_PATH environment variable to point the cache to $HOME/.cache of the running user.

I would like to know if vkd3d-proton can use a single shared cache file for every game (so $HOME/.cache/vkd3d-proton.cache) or if I have to create separate cache paths for every game ($HOME/.cache/*game*/vkd3d-proton.cache). Could there be conflicts if multiple games try to use the same cache file at the same time?

TTuupertunut 2026-02-16 github

It seems that if VKD3D_SHADER_CACHE_PATH is defined, the cache file name will be different for each game binary, something like vkd3d-proton.*game*.exe.cache. Maybe this could be mentioned in the readme. This still leaves the question of what happens if I run the same game twice, so that it has the same binary name.

HHansKristian-Work maintainer 2026-02-16 github

There is zero point in using the same cache for different games. It's detrimental at best.

TTuupertunut 2026-02-17 github

Ok, I understand, but would it still work if it happened accidentally or would the cache break somehow?
If you need context, I'm thinking of cases where two instances of the same game were running, or two games had identical binary names, like source engine games used to all have hl2.exe and some games just have game.exe.

HHansKristian-Work maintainer 2026-02-17 github

It should be robust against two instances of the same .exe name running at the same time, but it may clobber the cache spuriously. The cache implementation is not designed to be used like that.

TTuupertunut 2026-02-17 github

Ok, thanks for the info.

Launch options