GPU/HW: Fix toggling texture replacement settings
This commit is contained in:
parent
71bb953253
commit
08bdffac64
|
@ -557,10 +557,8 @@ void GPU_HW::UpdateSettings(const Settings& old_settings)
|
|||
{
|
||||
GPUTextureCache::Shutdown();
|
||||
}
|
||||
else if (m_use_texture_cache)
|
||||
{
|
||||
GPUTextureCache::UpdateSettings(old_settings);
|
||||
}
|
||||
|
||||
GPUTextureCache::UpdateSettings(m_use_texture_cache, old_settings);
|
||||
|
||||
if (g_settings.gpu_downsample_mode != old_settings.gpu_downsample_mode ||
|
||||
(g_settings.gpu_downsample_mode == GPUDownsampleMode::Box &&
|
||||
|
|
|
@ -561,28 +561,38 @@ bool GPUTextureCache::Initialize()
|
|||
return true;
|
||||
}
|
||||
|
||||
void GPUTextureCache::UpdateSettings(const Settings& old_settings)
|
||||
void GPUTextureCache::UpdateSettings(bool use_texture_cache, const Settings& old_settings)
|
||||
{
|
||||
UpdateVRAMTrackingState();
|
||||
|
||||
if (g_settings.texture_replacements.enable_texture_replacements !=
|
||||
old_settings.texture_replacements.enable_texture_replacements)
|
||||
if (use_texture_cache)
|
||||
{
|
||||
Invalidate();
|
||||
UpdateVRAMTrackingState();
|
||||
|
||||
DestroyPipelines();
|
||||
if (!CompilePipelines()) [[unlikely]]
|
||||
Panic("Failed to compile pipelines on TC settings change");
|
||||
if (g_settings.texture_replacements.enable_texture_replacements !=
|
||||
old_settings.texture_replacements.enable_texture_replacements)
|
||||
{
|
||||
Invalidate();
|
||||
|
||||
DestroyPipelines();
|
||||
if (!CompilePipelines()) [[unlikely]]
|
||||
Panic("Failed to compile pipelines on TC settings change");
|
||||
}
|
||||
}
|
||||
|
||||
// Reload textures if configuration changes.
|
||||
const bool old_replacement_scale_linear_filter = s_config.replacement_scale_linear_filter;
|
||||
if (LoadLocalConfiguration(false, false))
|
||||
if (LoadLocalConfiguration(false, false) ||
|
||||
g_settings.texture_replacements.enable_texture_replacements !=
|
||||
old_settings.texture_replacements.enable_texture_replacements ||
|
||||
g_settings.texture_replacements.enable_vram_write_replacements !=
|
||||
old_settings.texture_replacements.enable_vram_write_replacements)
|
||||
{
|
||||
if (s_config.replacement_scale_linear_filter != old_replacement_scale_linear_filter)
|
||||
if (use_texture_cache)
|
||||
{
|
||||
if (!CompilePipelines()) [[unlikely]]
|
||||
Panic("Failed to compile pipelines on TC replacement settings change");
|
||||
if (s_config.replacement_scale_linear_filter != old_replacement_scale_linear_filter)
|
||||
{
|
||||
if (!CompilePipelines()) [[unlikely]]
|
||||
Panic("Failed to compile pipelines on TC replacement settings change");
|
||||
}
|
||||
}
|
||||
|
||||
ReloadTextureReplacements(false);
|
||||
|
|
|
@ -103,7 +103,7 @@ struct Source
|
|||
};
|
||||
|
||||
bool Initialize();
|
||||
void UpdateSettings(const Settings& old_settings);
|
||||
void UpdateSettings(bool use_texture_cache, const Settings& old_settings);
|
||||
bool DoState(StateWrapper& sw, bool skip);
|
||||
void Shutdown();
|
||||
|
||||
|
|
|
@ -4418,6 +4418,11 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
|
|||
g_settings.display_line_end_offset != old_settings.display_line_end_offset ||
|
||||
g_settings.rewind_enable != old_settings.rewind_enable ||
|
||||
g_settings.runahead_frames != old_settings.runahead_frames ||
|
||||
g_settings.texture_replacements.enable_texture_replacements !=
|
||||
old_settings.texture_replacements.enable_texture_replacements ||
|
||||
g_settings.texture_replacements.enable_vram_write_replacements !=
|
||||
old_settings.texture_replacements.enable_vram_write_replacements ||
|
||||
g_settings.texture_replacements.dump_textures != old_settings.texture_replacements.dump_textures ||
|
||||
g_settings.texture_replacements.config != old_settings.texture_replacements.config)
|
||||
{
|
||||
g_gpu->UpdateSettings(old_settings);
|
||||
|
|
Loading…
Reference in New Issue