Ryujinx
Ryujinx copied to clipboard
UI: Add shader compiling counter
Implements a shader compile counter for Avalonia. Should easily let users see when stutter is due to a shader compile or something different.
Counter is transient and resets after 5 seconds of zero shader compiles.
Download the artifacts for this pull request:
- ryujinx-Release-1.1.0+124fe70-linux_arm64
- ryujinx-Release-1.1.0+124fe70-linux_x64
- ryujinx-Release-1.1.0+124fe70-macos_universal
- ryujinx-Release-1.1.0+124fe70-win_x64
Old GUI (GTK3)
GUI-less (SDL2)
Only for Developers
- ryujinx-Debug-1.1.0+124fe70-linux_arm64
- sdl2-ryujinx-headless-Debug-1.1.0+124fe70-linux_arm64
- gtk-ryujinx-Debug-1.1.0+124fe70-linux_arm64
- ryujinx-Debug-1.1.0+124fe70-linux_x64
- sdl2-ryujinx-headless-Debug-1.1.0+124fe70-linux_x64
- gtk-ryujinx-Debug-1.1.0+124fe70-linux_x64
- ryujinx-Debug-1.1.0+124fe70-macos_universal
- sdl2-ryujinx-headless-Debug-1.1.0+124fe70-macos_universal
- ryujinx-Debug-1.1.0+124fe70-win_x64
- sdl2-ryujinx-headless-Debug-1.1.0+124fe70-win_x64
- gtk-ryujinx-Debug-1.1.0+124fe70-win_x64
Also while compiling and leaving emulation the message gets stucks when stopping emulation
Also i've seen the message come back while PTC is being compiled.
There should be a setting to disable it (and I'd prefer if it's disabled by default). I don't think we want that showing all the time.
From your screenshots, the text is not centered, and is also not left or right aligned. It looks really weird as is IMO. I think it would look better if it was left aligned, after GPU, with the separator and all.
There should be a setting to disable it (and I'd prefer if it's disabled by default). I don't think we want that showing all the time.
I dont see any reason to not be enable by default, as i think a lot of people want this feature for a long time now.
There should be a setting to disable it (and I'd prefer if it's disabled by default). I don't think we want that showing all the time.
While it's unrelated to this PR, but it would be nice if Avalonia UI has support for overlay notification like Cemu. That way, users can enable/disable things they want, i.e. complied shader counter.
I understand this is to help prevent needless questions about stutter when it's about shader compilation, but I'd argue that this implementation won't change anything except for those who play in Windowed Mode (which would, I imagine, be a minority.) What Yell0wsuit brings up is the only solution I see to this, but it should be kept in mind that this question will change from "How do I fix my stuttering" to "how do I turn off shaders because they're lagging my game" -- just not as numerous.
Ready for review a second time.
- UI fixes (centre align and text ghosting between game boots).
- Reformatted the event args to vertical alignment (we have a lot of them now).
- Logic for accessing program count is now not exclusively limited to threaded renderer.
- Logic for text "cooldown" is now in UI, not backend.
As far as adding an option for this specifically, I can do that. But as this is completely transient (aka will disappear if no shaders are compiling), I personally don't see the use case? An overlay is beyond my abilities :)
I guess this is a "how many shaders were compiled in the last 5 seconds" counter rather than a counter for the number of in-flight compilations. Is that really the desired counter?
Review addressed.
@gdkchan I commented it under one of Ac_K's review comments but it isn't a "last 5s total" it's trying to capture the 'session' of stutter. It's a 5s grace period where if a new shader is compiled, it can be treated as the same session and restart the clock, and if nothing is compiled then the old session is over.
Review addressed.
@gdkchan I commented it under one of Ac_K's review comments but it isn't a "last 5s total" it's trying to capture the 'session' of stutter. It's a 5s grace period where if a new shader is compiled, it can be treated as the same session and restart the clock, and if nothing is compiled then the old session is over.
Is that how other emulators implement it? IMO it would make more sense to have a counter that indicates how many shader compilations are in-flight, no matter how long they take.
Is that how other emulators implement it? IMO it would make more sense to have a counter that indicates how many shader compilations are in-flight, no matter how long they take.
Pretty much yes. I've tried to follow Cemu behaviour because I personally find it very intuitive. Showing only in-flight compilations is fairly pointless because they happen so quickly and the status update only occurs when a new frame is rendered, at which point the shaders in question have already compiled.
Cemu for reference, notice how the behavior matches. If more shaders are compiled before the cooldown, they add to the counter and then only fade when enough time has passed.
https://github.com/Ryujinx/Ryujinx/assets/44103205/0a49b4f3-0aee-44c9-9e72-e65fa3495e45
this will be useful for me at least