mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 03:25:36 +00:00
GPU/TextureCache: Display replacement info on game start
This commit is contained in:
parent
0483117c70
commit
2b280bddd0
@ -299,7 +299,7 @@ bool GPU_HW::Initialize(bool upload_vram, Error* error)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Still potentially have VRAM texture replacements.
|
// Still potentially have VRAM texture replacements.
|
||||||
GPUTextureCache::ReloadTextureReplacements(false);
|
GPUTextureCache::ReloadTextureReplacements(System::GetState() == System::State::Starting, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateDownsamplingLevels();
|
UpdateDownsamplingLevels();
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
|
|
||||||
#include "IconsEmoji.h"
|
#include "IconsEmoji.h"
|
||||||
|
#include "IconsFontAwesome5.h"
|
||||||
|
|
||||||
#ifndef XXH_STATIC_LINKING_ONLY
|
#ifndef XXH_STATIC_LINKING_ONLY
|
||||||
#define XXH_STATIC_LINKING_ONLY
|
#define XXH_STATIC_LINKING_ONLY
|
||||||
@ -599,8 +600,12 @@ bool GPUTextureCache::Initialize(GPU_HW* backend, Error* error)
|
|||||||
s_state.hw_backend = backend;
|
s_state.hw_backend = backend;
|
||||||
|
|
||||||
SetHashCacheTextureFormat();
|
SetHashCacheTextureFormat();
|
||||||
ReloadTextureReplacements(false);
|
|
||||||
|
// note: safe because the CPU thread is waiting for the GPU thread to finish initializing
|
||||||
|
ReloadTextureReplacements(System::GetState() == System::State::Starting, false);
|
||||||
|
|
||||||
UpdateVRAMTrackingState();
|
UpdateVRAMTrackingState();
|
||||||
|
|
||||||
if (!CompilePipelines(error))
|
if (!CompilePipelines(error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -639,7 +644,7 @@ bool GPUTextureCache::UpdateSettings(bool use_texture_cache, const GPUSettings&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReloadTextureReplacements(false);
|
ReloadTextureReplacements(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateVRAMTrackingState();
|
UpdateVRAMTrackingState();
|
||||||
@ -2719,7 +2724,7 @@ size_t GPUTextureCache::DumpedTextureKeyHash::operator()(const DumpedTextureKey&
|
|||||||
|
|
||||||
void GPUTextureCache::GameSerialChanged()
|
void GPUTextureCache::GameSerialChanged()
|
||||||
{
|
{
|
||||||
ReloadTextureReplacements(false);
|
ReloadTextureReplacements(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
GPUTexture* GPUTextureCache::GetVRAMReplacement(u32 width, u32 height, const void* pixels)
|
GPUTexture* GPUTextureCache::GetVRAMReplacement(u32 width, u32 height, const void* pixels)
|
||||||
@ -3618,7 +3623,7 @@ bool GPUTextureCache::LoadLocalConfiguration(bool load_vram_write_replacement_al
|
|||||||
return (s_state.config != old_config);
|
return (s_state.config != old_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUTextureCache::ReloadTextureReplacements(bool show_info)
|
void GPUTextureCache::ReloadTextureReplacements(bool show_info, bool show_info_if_none)
|
||||||
{
|
{
|
||||||
s_state.dumped_textures.clear();
|
s_state.dumped_textures.clear();
|
||||||
s_state.dumped_vram_writes.clear();
|
s_state.dumped_vram_writes.clear();
|
||||||
@ -3655,11 +3660,14 @@ void GPUTextureCache::ReloadTextureReplacements(bool show_info)
|
|||||||
const int total =
|
const int total =
|
||||||
static_cast<int>(s_state.vram_replacements.size() + s_state.vram_write_texture_replacements.size() +
|
static_cast<int>(s_state.vram_replacements.size() + s_state.vram_write_texture_replacements.size() +
|
||||||
s_state.texture_page_texture_replacements.size());
|
s_state.texture_page_texture_replacements.size());
|
||||||
Host::AddIconOSDMessage("ReloadTextureReplacements", ICON_EMOJI_REFRESH,
|
if (total > 0 || show_info_if_none)
|
||||||
(total > 0) ? TRANSLATE_PLURAL_STR("GPU_HW", "%n replacement textures found.",
|
{
|
||||||
"Replacement texture count", total) :
|
Host::AddIconOSDMessage("ReloadTextureReplacements", ICON_FA_IMAGES,
|
||||||
TRANSLATE_STR("GPU_HW", "No replacement textures found."),
|
(total > 0) ? TRANSLATE_PLURAL_STR("GPU_HW", "%n replacement textures found.",
|
||||||
Host::OSD_INFO_DURATION);
|
"Replacement texture count", total) :
|
||||||
|
TRANSLATE_STR("GPU_HW", "No replacement textures found."),
|
||||||
|
Host::OSD_INFO_DURATION);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ bool AreSourcePagesDrawn(SourceKey key, const GSVector4i rect);
|
|||||||
void Compact();
|
void Compact();
|
||||||
|
|
||||||
void GameSerialChanged();
|
void GameSerialChanged();
|
||||||
void ReloadTextureReplacements(bool show_info);
|
void ReloadTextureReplacements(bool show_info, bool show_info_if_none);
|
||||||
|
|
||||||
// VRAM Write Replacements
|
// VRAM Write Replacements
|
||||||
GPUTexture* GetVRAMReplacement(u32 width, u32 height, const void* pixels);
|
GPUTexture* GetVRAMReplacement(u32 width, u32 height, const void* pixels);
|
||||||
|
@ -1399,7 +1399,8 @@ void GPUThread::SetGameSerial(std::string serial)
|
|||||||
s_state.game_serial = std::move(serial);
|
s_state.game_serial = std::move(serial);
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
GPUTextureCache::GameSerialChanged();
|
if (HasGPUBackend())
|
||||||
|
GPUTextureCache::GameSerialChanged();
|
||||||
if (SaveStateSelectorUI::IsOpen())
|
if (SaveStateSelectorUI::IsOpen())
|
||||||
SaveStateSelectorUI::RefreshList();
|
SaveStateSelectorUI::RefreshList();
|
||||||
}
|
}
|
||||||
|
@ -464,7 +464,7 @@ DEFINE_HOTKEY("ReloadPostProcessingShaders", TRANSLATE_NOOP("Hotkeys", "Graphics
|
|||||||
DEFINE_HOTKEY("ReloadTextureReplacements", TRANSLATE_NOOP("Hotkeys", "Graphics"),
|
DEFINE_HOTKEY("ReloadTextureReplacements", TRANSLATE_NOOP("Hotkeys", "Graphics"),
|
||||||
TRANSLATE_NOOP("Hotkeys", "Reload Texture Replacements"), [](s32 pressed) {
|
TRANSLATE_NOOP("Hotkeys", "Reload Texture Replacements"), [](s32 pressed) {
|
||||||
if (!pressed && System::IsValid())
|
if (!pressed && System::IsValid())
|
||||||
GPUThread::RunOnThread([]() { GPUTextureCache::ReloadTextureReplacements(true); });
|
GPUThread::RunOnThread([]() { GPUTextureCache::ReloadTextureReplacements(true, true); });
|
||||||
})
|
})
|
||||||
|
|
||||||
DEFINE_HOTKEY("IncreaseResolutionScale", TRANSLATE_NOOP("Hotkeys", "Graphics"),
|
DEFINE_HOTKEY("IncreaseResolutionScale", TRANSLATE_NOOP("Hotkeys", "Graphics"),
|
||||||
|
@ -1343,7 +1343,7 @@ void EmuThread::reloadTextureReplacements()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (System::IsValid())
|
if (System::IsValid())
|
||||||
GPUThread::RunOnThread([]() { GPUTextureCache::ReloadTextureReplacements(true); });
|
GPUThread::RunOnThread([]() { GPUTextureCache::ReloadTextureReplacements(true, true); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuThread::captureGPUFrameDump()
|
void EmuThread::captureGPUFrameDump()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user