Closed ghost closed 6 years ago
No.
There's no feasible way to know which shaders the game is going to use before it actually uses them. There are millions of possible combinations and you can't use past usage patterns to narrow the selection down either. You'd have to do AOT analysis or branch prediction on the code, and both of those are too slow to implement.
There are some ways of reducing the stutter though, such as skipping uncompiled shaders when drawing or storing the compilation input and allowing users to share it, but these solutions have their drawbacks as well.
Even doing it ahead of time isn't feasible, as it doesn't take runtime state into account. Shaders can be generated dynamically at runtime, after all.
The main problem is that we can consider that all games are not playable with the current solution of "shaders compilation". Games that are "playable" are games that can be used without freeze because of shaders compilations.
Closing ticket isn't a solution AniLeo. Isn't it possible to analyze all game datas files and know with that what shaders are necessary ?
It can be take time in the first time to detect and compile the needed shaders, but this solution will avoid all the freezes and shader compiling stutter during the first play of a game because RPCS3 will be "Compiling shaders".
The reason for this suggestion is if you look on the Web, your project RPCS3 got this main issue that downgrades major improvements that the team made in recent months
GitHub should add :man_facepalming: as a reaction, specifically for such issues.
Maybe for you is a stupid issue, i suggest you to check Google and see the search results about "Compiling shaders slutter". I'm not the first guy to report this and i propose a solution that is the following : "Isn't it possible to analyze all game datas files and know with that what shaders are necessary ?"
It can be take time in the first time to detect and compile the needed shaders, but this solution will avoid all the freezes and shader compiling stutter during the first play of a game because RPCS3 will be "Compiling shaders".
Nothing is impossible of course, you could give a team of 100 google engineers infinite money to come up with something worthy of a nobel prize. But there is no real solution that will be implemented now or even in the near future. Yes compiling shaders sucks. But that's how it is.
So second question : if compiling shaders sucks as you said it, are shaders necessary ? Can they be disabled ?
@JackoboLeChocobo you are free to open a Pull Request which implements pre-compiling shaders, I am sure nobody will stop you.
But first please get a basic understanding of how modern GPUs work, how modern game engines work, and then you'll be able to answer all of your current questions yourself. You can start with something like this: https://simonschreibt.de/gat/renderhell/ Also github issues is not the place for this discussion, please come to rpcs3 discord for this.
@13xforever that's why i have these questions : i'm not "Wikipedia" in this domain. Is it a crime to have questions on a specific domain in 2018 ?
@Renusek So I will fork the code database and check that.
At least come on Discord and ask instead of bothering the 600 people following this repo. You said it youself that you suspected the question was stupid. If you continue posting here you'll most likely be banned from the repo.
Yes it's closed, you've been answered in detail already, it's also not the first time people have asked this.
You can't disable shader compilation, if you try to ignore shaders and proceed to the next frames it will just render a bunch of trash and just make you want to rip your eyes off by the words of kd-11.
@JackoboLeChocobo Worth pointing out that older and more mature emulators, that emulate a simpler architecture, such as dolphin, just very recently got rid of shader compilation stuttering, and it was not trivial. They have a very well detailed blog post about it here. You might give it a read to understand the problem, it's very carefully written.
@henriquenj Thanks for your answer and for the article you linked here.
So second question : if compiling shaders sucks as you said it, are shaders necessary ? Can they be disabled ?
Shaders are basically the backbone of 3D graphics, so no. They can't be disabled.
@torresmatt Thanks for necroing a six month old question that has already been answered here many times.
Is this your repository? Are you an admin on it? I found the thread on google and admit I didn't look at the dates, but the thread wasn't locked. Sorry for the lack of vigilance but I'd say overall this seems like a moderation issue. Thanks for the sarcasm and hostility! Definitely not enough of that online.
Serious ( and probably stupid but i prefer to say it in case of ) question.
Isn't it possible for RPCS3 to compile all the needed shaders before launching the game ? ( We can see at the second launch that RPCS3 preloads the compiled shaders )
It will avoid the FPS down and the freezes of the game for all users because RPCS3 is "Compiling shaders".