xenia-project / xenia

Xbox 360 Emulator Research Project
https://xenia.jp
Other
8.27k stars 1.14k forks source link

[GPU] Alert user when compiling shaders #1314

Open niko1point0 opened 5 years ago

niko1point0 commented 5 years ago

The RPCS3 (PlayStation 3) Emulator has a message in the corner of the screen that says “compiling shaders...” whenever asynchronous compilation occurs. Can Xenia have this feature?

DrChat commented 5 years ago

This is doable - but we will need to write some code that can draw text onscreen (or hijack one of our UI frameworks to do the drawing for us).

Triang3l commented 5 years ago

I don't think we're ever going to compile pipeline state objects the way RPCS3 does that, though. I've heard there are games doing mipmap generation on the GPU — we can't just drop draw calls in such cases since they occur only once per the game's lifetime. Dolphin had Mii faces not displayed when they experimented with that also. XUI text rendering relies on that too — and glyphs are often rendered to a texture only once. Also it's not such a big problem for us — unlike RPCS3, we don't generate shaders in a text language, the whole process is much faster in Xenia, so mid-game stuttering is not that significant (load-time is pretty terrible in some games though, but saving the pipeline compilation history and replaying it while starting the game should greatly reduce that on the second time the game is played). Freezing with "compiling shaders" would probably be even more immersion-breaking than simply freezing also, I think.

niko1point0 commented 5 years ago

Sounds great! Thank you for the hard work

DrChat commented 5 years ago

@Triang3l You're right - skipping drawcalls when the shader is not available isn't too great of an idea. But if the game freezes, it helps to know that it's frozen because Xenia is working at compiling shaders, and not because the game has crashed. I'm thinking we can simply drop some text into the corner of the screen, maybe with an option to disable it if need be.