Skip to content
Permalink
Browse files

ShaderCache: Recompile shared pipelines on shader cache reload

Fixes broken stereoscopy when switching on/off at runtime.
  • Loading branch information...
stenzek committed Oct 1, 2019
1 parent ee30fc9 commit c989e5c50c432b7df78a8e6e1dc92cca1057767b
Showing with 20 additions and 0 deletions.
  1. +20 −0 Source/Core/VideoCommon/ShaderCache.cpp
@@ -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);

0 comments on commit c989e5c

Please sign in to comment.
You can’t perform that action at this time.