PDA

View Full Version : Idea for a script to compile shaders for all games in a folder



TheManuel
07.11.2017, 20:36
Hello.

If anybody is up to the task and sees the value, it would be useful to have a tool that would automatically launch Cemu long enough to compile all shaders for a game, then move on to the next game in a directory until all shaders are compiled. This way, after you update Cemu, you can leave this running overnight so that next time you launch any game you won't have to wait for the shaders to do the first compilation, which can take a long time.

It would be even better if this feature were integrated into Cemu itself ("pre-compile all shaders" or something like that), but an external script would do the trick.

epigramx
08.11.2017, 03:20
Shaders don't compile themselves regardless, they are compiled when the games need them. To put it simply, if you have already used the shaders needed for the current scene, the caching is already complete for that scene and no more is needed. You will need to move to another area of a game or use other abilities to compile more shaders.

Cemu could in theory pre-scan for all shaders but when I asked Exzap for it he said while it is theoretically possible, some games shaders depend on the current state (what happens at a game's data at the moment of compilation) so that wouldn't be applicable properly.

It's very doubtful an "external script" would do it without the devs' support, unless it's done at a very low level of Cemu.exe hacking.

PS. A game might use additional shaders if left overnight if it employs additional effects automatically (e.g. BotW's time of the day and blood moon effects) but those are usually a small part of what is there.

TheManuel
08.11.2017, 05:12
Hi, epigramx.

Sorry, I should have been more specific. I'm referring to the shareable cache that can be downloaded from other users. On a game like MK8 with over 11,000 shaders available for sharing, the first time it is compiled it takes over a minute. Once it is compiled the first time, it loads in less than 10 seconds. This has to be done after updating Cemu to a new version or updating the GPU drivers. If a script could simply launch Cemu and let that initial compilation take place automatically for each game, then we don't have to wait that much when playing game after updates.

epigramx
08.11.2017, 06:26
Sure though don't expect much support from the devs since sharing caches is considered piracy in most jurisdictions because they contain binary shaders for the Wii U GPU.

TheManuel
08.11.2017, 12:56
Sure though don't expect much support from the devs since sharing caches is considered piracy in most jurisdictions because they contain binary shaders for the Wii U GPU.

OK, I had not idea sharing the transferable cache was a touchy subject, since there are even instructions on how to do this and links to cache downloads in the wiki (http://compat.cemu.info/wiki/Tutorial:Shader_Cache). Nonetheless, I'll drop the topic if it has the smallest possibility of causing any trouble.

epigramx
08.11.2017, 15:43
OK, I had not idea sharing the transferable cache was a touchy subject, since there are even instructions on how to do this and links to cache downloads in the wiki (http://compat.cemu.info/wiki/Tutorial:Shader_Cache). Nonetheless, I'll drop the topic if it has the smallest possibility of causing any trouble.
It's not always piracy since you may be sharing them between your own hardware, relatives or in countries where laws are lax. I just said that since Cemu devs operate with popular norms relating to anonymous internet users, they won't easily create tools that depend on shared caches but you never know!

TheManuel
08.11.2017, 15:53
Understood. Thanks for your help.