diff --git a/docs/PHASE_LOG.md b/docs/PHASE_LOG.md index f0bef26..5120d23 100644 --- a/docs/PHASE_LOG.md +++ b/docs/PHASE_LOG.md @@ -3919,3 +3919,34 @@ core-options file and no history): 20 s (25 times): no crash, every audio window 98-100%. tools/verify.sh PASS; ../PS5_Vulkan tools/check-driver.sh PASS. + +## 2026-09-26 — Dolphin at its best settings: the PS5 defaults, and what Rogue Leader still needs + +Dolphin's defaults were upstream's: 1x, Synchronous shader compilation, no +anisotropic filtering. Profile 12 (`tooling/dolphin-profiles/p12-ps5-best.txt`) +is the best picture that holds full speed, every accuracy setting at Dolphin's +default: 6x, Async (UberShaders) -- exact ubershaders draw while the specialised +shaders compile in the background, so nothing is skipped and nothing stalls -- +16x anisotropic filtering and texture decoding on the GPU. From my save states, +Resident Evil 4, Melee, Wind Waker and Mario Kart Wii held 100% in every window +after the one that boots and loads the state (title 870bd1bb). + +The port now makes these the defaults (patches/dolphin/ps5-port.patch, +`Ps5ApplyDefaultProfile`), and like the PPSSPP port it sets an options file an +earlier core saved aside once, as `dolphin-emu.opt.before-ps5-profile`, because +RetroArch would otherwise keep its values over the new defaults. It makes the +options folder first, open to FTP, so the marker (`ps5-default-profile-v1`) exists +even where Dolphin's options were never saved. On my console (title b8d43519) my +file was set aside, RetroArch wrote the new one with the four profile values and +every other option as mine had it, and Wind Waker ran at 100% after boot. + +Rogue Leader is the exception, and it is the driver's. Its attract sequence runs +at 73-85% for stretches and its gameplay (my Death Star Attack state) dips to +90-97%, with every shader cached as much as cold. Sampled, Dolphin's GPU thread +waits on its CPU thread and the other way round, and on the GPU thread the +driver's transfers done by the CPU at submission split points -- uploads into +tiled images, then image copies once texture decoding is on the GPU, each after +waiting for the GPU -- are the largest cost that is not Dolphin's own. That is +../PS5_Vulkan R95: those transfers on the GPU. R94 (compiles on several threads +at once, ../PS5_Vulkan 6078307) removed the GPU thread's waits behind the +compiler's lock; cold, Rogue Leader's first window went from 77% to 82%. diff --git a/patches/dolphin/ps5-port.patch b/patches/dolphin/ps5-port.patch index 6d12907..80ed20f 100644 --- a/patches/dolphin/ps5-port.patch +++ b/patches/dolphin/ps5-port.patch @@ -565,6 +565,86 @@ index c53281053f..885cdfac84 100644 Libretro::Log::LogFrontEnd(style, caption, text, 2000); return true; // Always "continue" }); +diff --git a/Source/Core/DolphinLibretro/Common/Options.cpp b/Source/Core/DolphinLibretro/Common/Options.cpp +index 7d27a1ea3c..0d882dcb74 100644 +--- a/Source/Core/DolphinLibretro/Common/Options.cpp ++++ b/Source/Core/DolphinLibretro/Common/Options.cpp +@@ -1,6 +1,13 @@ + + #include ++#include + #include ++#include ++#ifdef __PROSPERO__ ++#include ++#include ++#include ++#endif + #include "DolphinLibretro/Common/Options.h" + + namespace Libretro +@@ -1870,9 +1877,61 @@ void Init() + CheckForUpdatedVariables(); + } + ++#ifdef __PROSPERO__ ++// PS5 port: the defaults are the best picture that holds full speed on the ++// console (tooling/dolphin-profiles/p12-ps5-best.txt in the title's repository): ++// 6x internal resolution, asynchronous ubershaders -- exact ubershaders draw ++// while the specialised shaders compile in the background, so nothing is ++// skipped and nothing stalls -- 16x anisotropic filtering, and texture decoding ++// on the GPU. Every accuracy setting keeps Dolphin's default. Resident Evil 4, ++// Melee, Wind Waker and Mario Kart Wii held 100% in every window after boot. ++static void Ps5ApplyDefaultProfile() ++{ ++ static const struct ++ { ++ const char* key; ++ const char* value; ++ } profile[] = { ++ {Libretro::Options::gfx_settings::EFB_SCALE, "6"}, ++ {Libretro::Options::gfx_settings::SHADER_COMPILATION_MODE, "2"}, ++ {Libretro::Options::gfx_enhancements::MAX_ANISOTROPY, "4"}, ++ {Libretro::Options::gfx_settings::GPU_TEXTURE_DECODING, "enabled"}, ++ }; ++ for (retro_core_option_v2_definition* def = option_defs; def->key; ++def) ++ for (const auto& entry : profile) ++ if (!std::strcmp(def->key, entry.key)) ++ def->default_value = entry.value; ++ ++ // Once: an options file saved by an earlier core keeps its values over these ++ // defaults (RetroArch reads it when the options are set, just after this), so ++ // the first run of this profile sets it aside, recoverable, as the PPSSPP port ++ // does. The folder is made first, open to FTP, so the marker exists even on a ++ // console that has never saved Dolphin's options. ++ const char* const folder = "/app0/config/dolphin-emu"; ++ const char* const saved = "/app0/config/dolphin-emu/dolphin-emu.opt"; ++ const char* const marker = "/app0/config/dolphin-emu/ps5-default-profile-v1"; ++ struct stat status; ++ if (stat(marker, &status) == 0) ++ return; ++ if (mkdir(folder, 0777) == 0) ++ chmod(folder, 0777); ++ if (stat(saved, &status) == 0) ++ std::rename(saved, "/app0/config/dolphin-emu/dolphin-emu.opt.before-ps5-profile"); ++ const int fd = open(marker, O_WRONLY | O_CREAT | O_TRUNC, 0666); ++ if (fd >= 0) ++ { ++ fchmod(fd, 0666); ++ close(fd); ++ } ++} ++#endif ++ + void SetVariables() + { + unsigned version = 0; ++#ifdef __PROSPERO__ ++ Ps5ApplyDefaultProfile(); ++#endif + + struct retro_core_options_v2 options_us = { + const_cast(option_cats), diff --git a/Source/Core/DolphinLibretro/Main.cpp b/Source/Core/DolphinLibretro/Main.cpp index cd8753b666..85271453ba 100644 --- a/Source/Core/DolphinLibretro/Main.cpp diff --git a/tooling/dolphin-profiles/README.md b/tooling/dolphin-profiles/README.md index 2690d01..9a183c9 100644 --- a/tooling/dolphin-profiles/README.md +++ b/tooling/dolphin-profiles/README.md @@ -16,6 +16,7 @@ any launch that is not a test run, so a profile never outlives its run. | `p5-ram-efb.txt` | 5: profile 4 with EFB copies to RAM (read back through the CPU) | | `p6-scale-Nx.txt` | 6: the scaling ladder, 1x to 6x on the accurate baseline | | `p7-msaa-N.txt`, `p7-max-torture.txt` | 7: 2x/4x/8x MSAA on the accurate baseline, and 6x with 8x MSAA and profile 3's settings | +| `p12-ps5-best.txt` | 12: the PS5 defaults -- 6x, asynchronous ubershaders, 16x AF, GPU texture decoding | Each file names the options its profile is defined by, rather than relying on the core's defaults for them. diff --git a/tooling/dolphin-profiles/p12-ps5-best.txt b/tooling/dolphin-profiles/p12-ps5-best.txt new file mode 100644 index 0000000..fe82765 --- /dev/null +++ b/tooling/dolphin-profiles/p12-ps5-best.txt @@ -0,0 +1,15 @@ +# Profile 12, the PS5 defaults (patches/dolphin/ps5-port.patch): the best picture +# that holds full speed. 6x internal resolution, asynchronous ubershaders (exact +# ubershaders draw while the specialised shaders compile in the background, so +# nothing is skipped and nothing stalls), 16x anisotropic filtering, texture +# decoding on the GPU; every accuracy setting at Dolphin's default. +dolphin_renderer=Hardware +dolphin_cpu_core=1 +dolphin_fastmem=enabled +dolphin_cpu_clock_rate=1.00 +dolphin_efb_scale=6 +dolphin_shader_compilation_mode=2 +dolphin_wait_for_shaders=disabled +dolphin_max_anisotropy=4 +dolphin_anti_aliasing=0 +dolphin_gpu_texture_decoding=enabled