From c3d6d2189a63f93db2ed2e8879f6f101e2e388fe Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Thu, 5 Sep 2024 13:12:24 -0700 Subject: [PATCH] Texture Dumping: Show OSD message on startup and when toggled If texture dumping is enabled, notify the user on emulation startup using an On Screen Display message. Also notify the user when texture dumping is toggled. Addresses https://bugs.dolphin-emu.org/issues/12445. --- Source/Core/DolphinQt/HotkeyScheduler.cpp | 9 ++++++++- Source/Core/VideoCommon/VideoBackendBase.cpp | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/HotkeyScheduler.cpp b/Source/Core/DolphinQt/HotkeyScheduler.cpp index bc441dcef4d..95d7b95a4e1 100644 --- a/Source/Core/DolphinQt/HotkeyScheduler.cpp +++ b/Source/Core/DolphinQt/HotkeyScheduler.cpp @@ -469,7 +469,14 @@ void HotkeyScheduler::Run() } if (IsHotkey(HK_TOGGLE_DUMPTEXTURES)) - Config::SetCurrent(Config::GFX_DUMP_TEXTURES, !Config::Get(Config::GFX_DUMP_TEXTURES)); + { + const bool enable_dumping = !Config::Get(Config::GFX_DUMP_TEXTURES); + Config::SetCurrent(Config::GFX_DUMP_TEXTURES, enable_dumping); + OSD::AddMessage( + fmt::format("Texture Dumping {}", + enable_dumping ? "enabled. This will reduce performance." : "disabled."), + OSD::Duration::NORMAL); + } if (IsHotkey(HK_TOGGLE_TEXTURES)) Config::SetCurrent(Config::GFX_HIRES_TEXTURES, !Config::Get(Config::GFX_HIRES_TEXTURES)); diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index a5d309cc963..1db7fb2ab68 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -52,6 +52,7 @@ #include "VideoCommon/GeometryShaderManager.h" #include "VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h" #include "VideoCommon/IndexGenerator.h" +#include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/OpcodeDecoding.h" #include "VideoCommon/PixelEngine.h" #include "VideoCommon/PixelShaderManager.h" @@ -392,6 +393,12 @@ bool VideoBackendBase::InitializeShared(std::unique_ptr gfx, g_Config.VerifyValidity(); UpdateActiveConfig(); + if (g_Config.bDumpTextures) + { + OSD::AddMessage(fmt::format("Texture Dumping is enabled. This will reduce performance."), + OSD::Duration::NORMAL); + } + g_shader_cache->InitializeShaderCache(); return true;