mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
InputCommon: Introducing the "Dynamic Input Texture". Configuration links an emulated input action to an image based on what host key is defined for that emulated input. Specific regions are called out in configuration that mark where to replace an input button with a host key image.
This commit is contained in:
@ -76,8 +76,7 @@ void HiresTexture::Update()
|
||||
|
||||
if (!g_ActiveConfig.bHiresTextures)
|
||||
{
|
||||
s_textureMap.clear();
|
||||
s_textureCache.clear();
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -146,6 +145,12 @@ void HiresTexture::Update()
|
||||
}
|
||||
}
|
||||
|
||||
void HiresTexture::Clear()
|
||||
{
|
||||
s_textureMap.clear();
|
||||
s_textureCache.clear();
|
||||
}
|
||||
|
||||
void HiresTexture::Prefetch()
|
||||
{
|
||||
Common::SetCurrentThreadName("Prefetcher");
|
||||
|
@ -22,6 +22,7 @@ class HiresTexture
|
||||
public:
|
||||
static void Init();
|
||||
static void Update();
|
||||
static void Clear();
|
||||
static void Shutdown();
|
||||
|
||||
static std::shared_ptr<HiresTexture> Search(const u8* texture, size_t texture_size,
|
||||
|
@ -1138,6 +1138,11 @@ void Renderer::EndUIFrame()
|
||||
BeginImGuiFrame();
|
||||
}
|
||||
|
||||
void Renderer::ForceReloadTextures()
|
||||
{
|
||||
m_force_reload_textures.Set();
|
||||
}
|
||||
|
||||
// Heuristic to detect if a GameCube game is in 16:9 anamorphic widescreen mode.
|
||||
void Renderer::UpdateWidescreenHeuristic()
|
||||
{
|
||||
@ -1302,9 +1307,17 @@ void Renderer::Swap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u6
|
||||
// state changes the specialized shader will not take over.
|
||||
g_vertex_manager->InvalidatePipelineObject();
|
||||
|
||||
// Flush any outstanding EFB copies to RAM, in case the game is running at an uncapped frame
|
||||
// rate and not waiting for vblank. Otherwise, we'd end up with a huge list of pending copies.
|
||||
g_texture_cache->FlushEFBCopies();
|
||||
if (m_force_reload_textures.TestAndClear())
|
||||
{
|
||||
g_texture_cache->ForceReload();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Flush any outstanding EFB copies to RAM, in case the game is running at an uncapped frame
|
||||
// rate and not waiting for vblank. Otherwise, we'd end up with a huge list of pending
|
||||
// copies.
|
||||
g_texture_cache->FlushEFBCopies();
|
||||
}
|
||||
|
||||
if (!is_duplicate_frame)
|
||||
{
|
||||
|
@ -259,6 +259,9 @@ public:
|
||||
void BeginUIFrame();
|
||||
void EndUIFrame();
|
||||
|
||||
// Will forcibly reload all textures on the next swap
|
||||
void ForceReloadTextures();
|
||||
|
||||
protected:
|
||||
// Bitmask containing information about which configuration has changed for the backend.
|
||||
enum ConfigChangeBits : u32
|
||||
@ -410,6 +413,8 @@ private:
|
||||
void FinishFrameData();
|
||||
|
||||
std::unique_ptr<NetPlayChatUI> m_netplay_chat_ui;
|
||||
|
||||
Common::Flag m_force_reload_textures;
|
||||
};
|
||||
|
||||
extern std::unique_ptr<Renderer> g_renderer;
|
||||
|
@ -137,6 +137,17 @@ void TextureCacheBase::Invalidate()
|
||||
texture_pool.clear();
|
||||
}
|
||||
|
||||
void TextureCacheBase::ForceReload()
|
||||
{
|
||||
Invalidate();
|
||||
|
||||
// Clear all current hires textures, they are invalid
|
||||
HiresTexture::Clear();
|
||||
|
||||
// Load fresh
|
||||
HiresTexture::Update();
|
||||
}
|
||||
|
||||
void TextureCacheBase::OnConfigChanged(const VideoConfig& config)
|
||||
{
|
||||
if (config.bHiresTextures != backup_config.hires_textures ||
|
||||
|
@ -205,6 +205,7 @@ public:
|
||||
bool Initialize();
|
||||
|
||||
void OnConfigChanged(const VideoConfig& config);
|
||||
void ForceReload();
|
||||
|
||||
// Removes textures which aren't used for more than TEXTURE_KILL_THRESHOLD frames,
|
||||
// frameCount is the current frame number.
|
||||
|
Reference in New Issue
Block a user