Skip to content
Permalink
Browse files

Merge pull request #8375 from stenzek/stereo-switch

Fix runtime stereoscopy mode switching
  • Loading branch information...
stenzek committed Oct 2, 2019
2 parents b319f82 + 135f0a1 commit dafb0173b7cd945ae57604ce8d4555b92c5b7162
Showing with 20 additions and 3 deletions.
  1. +20 −3 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);
@@ -1168,10 +1188,7 @@ const AbstractPipeline* ShaderCache::GetEFBCopyToRAMPipeline(const EFBCopyParams
}

AbstractPipelineConfig config = {};
config.vertex_format = nullptr;
config.vertex_shader = m_screen_quad_vertex_shader.get();
config.geometry_shader =
UseGeometryShaderForEFBCopies() ? m_texcoord_geometry_shader.get() : nullptr;
config.pixel_shader = shader.get();
config.rasterization_state = RenderState::GetNoCullRasterizationState(PrimitiveType::Triangles);
config.depth_state = RenderState::GetNoDepthTestingDepthState();

0 comments on commit dafb017

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