ShaderCache: Recompile shared pipelines on shader cache reload

Fixes broken stereoscopy when switching on/off at runtime.
This commit is contained in:
Stenzek 2019-10-01 11:42:59 +10:00
parent ee30fc9ad5
commit c989e5c50c
1 changed files with 20 additions and 0 deletions

View File

@ -70,6 +70,9 @@ void ShaderCache::Reload()
ClosePipelineUIDCache();
ClearCaches();
if (!CompileSharedPipelines())
PanicAlert("Failed to compile shared pipelines after reload.");
if (g_ActiveConfig.bShaderCache)
LoadCaches();
@ -369,6 +372,23 @@ void ShaderCache::ClearCaches()
ClearShaderCache(m_uber_vs_cache);
ClearShaderCache(m_uber_ps_cache);
m_screen_quad_vertex_shader.reset();
m_texture_copy_vertex_shader.reset();
m_efb_copy_vertex_shader.reset();
m_texcoord_geometry_shader.reset();
m_color_geometry_shader.reset();
m_texture_copy_pixel_shader.reset();
m_color_pixel_shader.reset();
m_efb_copy_to_vram_pipelines.clear();
m_efb_copy_to_ram_pipelines.clear();
m_copy_rgba8_pipeline.reset();
m_rgba8_stereo_copy_pipeline.reset();
for (auto& pipeline : m_palette_conversion_pipelines)
pipeline.reset();
m_texture_reinterpret_pipelines.clear();
m_texture_decoding_shaders.clear();
SETSTAT(g_stats.num_pixel_shaders_created, 0);
SETSTAT(g_stats.num_pixel_shaders_alive, 0);
SETSTAT(g_stats.num_vertex_shaders_created, 0);