diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 0f0d8c81..00f998a3 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -61,6 +61,7 @@ bool GPU_HW::Initialize(HostDisplay* host_display) m_chroma_smoothing = g_settings.gpu_24bit_chroma_smoothing; m_downsample_mode = GetDownsampleMode(m_resolution_scale); m_disable_color_perspective = m_supports_disable_color_perspective && ShouldDisableColorPerspective(); + m_shader_precompile_mode = g_settings.gpu_shader_precompile_mode; if (m_multisamples != g_settings.gpu_multisamples) { @@ -144,7 +145,8 @@ void GPU_HW::UpdateHWSettings(bool* framebuffer_changed, bool* shaders_changed) m_scaled_dithering != g_settings.gpu_scaled_dithering || m_texture_filtering != g_settings.gpu_texture_filter || m_using_uv_limits != use_uv_limits || m_chroma_smoothing != g_settings.gpu_24bit_chroma_smoothing || m_downsample_mode != downsample_mode || m_pgxp_depth_buffer != g_settings.UsingPGXPDepthBuffer() || - m_disable_color_perspective != disable_color_perspective); + m_disable_color_perspective != disable_color_perspective || + m_shader_precompile_mode != g_settings.gpu_shader_precompile_mode); m_resolution_scale = resolution_scale; m_multisamples = multisamples; @@ -156,6 +158,7 @@ void GPU_HW::UpdateHWSettings(bool* framebuffer_changed, bool* shaders_changed) m_chroma_smoothing = g_settings.gpu_24bit_chroma_smoothing; m_downsample_mode = downsample_mode; m_disable_color_perspective = disable_color_perspective; + m_shader_precompile_mode = g_settings.gpu_shader_precompile_mode; if (!m_supports_dual_source_blend && TextureFilterRequiresDualSourceBlend(m_texture_filtering)) m_texture_filtering = GPUTextureFilter::Nearest; diff --git a/src/core/gpu_hw.h b/src/core/gpu_hw.h index 1b9159fa..a886e198 100644 --- a/src/core/gpu_hw.h +++ b/src/core/gpu_hw.h @@ -360,6 +360,16 @@ protected: bool m_using_uv_limits = false; bool m_pgxp_depth_buffer = false; + // Previous-value cache of g_settings.gpu_shader_precompile_mode + // so UpdateHWSettings can detect a runtime flip and route it + // through the same destroy/recompile path the other shader- + // affecting settings use. Without this, switching the mode at + // runtime would silently fail to apply: the existing Lazy + // worker would keep running (or not be spawned) regardless of + // the new value, because shaders_changed wouldn't fire on a + // pure precompile-mode change. + GPUShaderPrecompileMode m_shader_precompile_mode = GPUShaderPrecompileMode::Lazy; + BatchConfig m_batch; BatchUBOData m_batch_ubo_data = {};