This was causing the game to output thousands of FPS during the loading screen when it would run uncapped if Immediately Present XFB was enabled.
Please see Redmine 13447 for reference.
This is another one of those games that has an optional screenshot
feature where the images end up all black if you have Store EFB Copies
to Texture Only turned on. Like for other such games, let's not force
Store EFB Copies to Texture Only off, since it's a large performance
impact for a feature most players won't use.
There's one wrinkle here. As part of teaching the player how to take
screenshots, the game forces the player to take a screenshot before it
lets them progress in the story. However, the game doesn't care what's
in the screenshot, so you can progress just fine even if Store EFB
Copies to Texture Only is turned on. I personally tested it.
For buttons and some character icons the game loads palleted PNGs and
tiles the pallet indices directly into C4 textures but fails to take
into account that PNG and C4 use opposite nibble orders. This causes
adjacent pixel columns to be swapped, see issue 13370.
Also disable Immediate XFB for the Japanese release. It has the same
black screen and flickering issues as the other regions.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.
Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).
Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.
This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.
Fixes: https://bugs.dolphin-emu.org/issues/8941
Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
These games seem to constantly have unused vertices, and this is worst shown in the Shadow Pokemon purification cutscene. The Shadow Pokemon purification cutscene is even worse on XD with forced single core mode, as instead of having FPS dropping with VPS staying 60ish, it will drop both, resulting in audio stuttering. Turning on CPUCall seems to have a 7/8 reduction of draw calls for that cutscene (~800 -> ~100), doubling performance. Many other areas of the game seem to benefit from this setting too, having some kind of performance boost.
See https://bugs.dolphin-emu.org/issues/13248. This is needed for the menus to work properly (not run at 1FPS and render incorrectly). Additionally, immediate XFB causes flickering.