Query the display's HDR min/max luminance and feed those values into the post-processing pipeline and shaders.
- Add SwapChain::QueryDisplayHDRCapabilities(), include dxgi1_6, and call it during swapchain creation and resize to populate g_backend_info.hdr_max_luminance_nits and hdr_min_luminance_nits.
- Extend BackendInfo with hdr_max_luminance_nits and hdr_min_luminance_nits.
- Add hdr_max_luminance_nits/min to the built-in uniform block and fill them in PostProcessing::FillUniformBuffer so shaders can access actual panel values.
- Update AutoHDR.glsl to use the reported hdr_max_luminance_nits (with a fallback to HDR_DISPLAY_MAX_NITS) when computing the auto-HDR white scaling.
This enables more accurate AutoHDR tonemapping by using the display's real luminance capabilities when available.
This should stop AchievementManager::LoadGame from being called for the
default ISO when CBoot::BootUp is booting something other than a disc or
IPL (most notably, the Wii Menu), while still detecting all disc changes
that happen while a disc game is running.
Don't copy null terminators from the log's `header.gameid` into
`FifoDataFile`'s `m_game_id`.
Doing so would cause an infinite loop in `Core::GenerateScreenshotName`
as the various concatenations and `fmt::format` calls would then
effectively drop all the timestamps and disambiguating arbitrary numbers
since they followed the null terminator in the gameid, and so the
`File::Exists` calls would always return true.
Fixes https://bugs.dolphin-emu.org/issues/14002.
Check the return value of calls to `GetBuffer` and stop the `WASAPI
handler` sound thread if they fail.
This prevents a crash due to a null pointer dereference if `GetBuffer`
is unable to retrieve a buffer, which could be triggered during
emulation by disabling the selected WASAPI output device in the Windows
Sound settings.
Reasons:
- Only 0.000341% of all Android users were on API 21-23 in the last 365 days.
- These devices are old and likely do not run Dolphin well.
- Android 5.x and 6.0 have been without security updates for about 8 years.
- Staying on API 21–23 blocks AndroidX updates, including Lifecycle.
Added SerialDevice base class interface.
Adapted MagneticCardReader to use the SerialDevice interface.
Implemented The Key of Avalon touchscreen SerialDevice.
Altered CSIDevice_AMBaseboard to use SerialDevice.
Made serial reads happen every GCAMCommand rather than only upon write.
Use the normal state changed `HookableEvent` instead of having
`Core::NotifyStateChanged` call `g_perf_metrics.OnEmulationStateChanged`
directly.
The direct call was added in bad78cfed4 to
avoid a crash. At the time state changed callbacks were stored in a
vector, and the crash was caused by `g_perf_metric`'s destructor trying
to remove the callback from the already-destroyed vector.
Later a97627e736 switched state changed
callbacks to use `HookableEvent`, which is specifically designed to
handle the case where a hook outlives its associated event.
Since the workaround is no longer necessary replace it with a standard
`EventHook`.
This switches from an O(log(N) * M) algorithm to an O(N * log(M))
algorithm. This is advantageous because N, the size of `mappings`, is
usually much smaller than M, the size of `m_page_table_mapped_entries`.
RemoveLargePageTableMapping already did something similar, so we can
even deduplicate some code between it and RemoveHostPageTableMappings.
Speeds up Rogue Squadron 3 by roughly 3% on my PC.
If Dolphin crashes, changes that have been made to settings are often
lost. This has been a minor annoyance for me when developing, but it has
become a much bigger issue recently due to the problem where Dolphin
freezes on shutdown for ROG Ally users.
Instead of saving the config when certain arbitrary settings are
changed, let's save the config when the user closes the settings window.