From a49d0b665f75721834170819fd057dbd7f19e53a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 16 Oct 2025 16:32:23 +1000 Subject: [PATCH] PostProcessing/GLSL: Skip recompile on target size change This is specific to reshade. --- src/util/postprocessing_shader_glsl.cpp | 8 ++++++-- src/util/postprocessing_shader_glsl.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/util/postprocessing_shader_glsl.cpp b/src/util/postprocessing_shader_glsl.cpp index 39f39a9ed..e09978fb9 100644 --- a/src/util/postprocessing_shader_glsl.cpp +++ b/src/util/postprocessing_shader_glsl.cpp @@ -124,8 +124,11 @@ void PostProcessing::GLSLShader::FillUniformBuffer(void* buffer, s32 viewport_x, bool PostProcessing::GLSLShader::CompilePipeline(GPUTexture::Format format, u32 width, u32 height, Error* error, ProgressCallback* progress) { - if (m_pipeline) - m_pipeline.reset(); + if (m_output_format == format) + return true; + + m_pipeline.reset(); + m_output_format = GPUTexture::Format::Unknown; PostProcessingGLSLShaderGen shadergen(g_gpu_device->GetRenderAPI(), g_gpu_device->GetFeatures().dual_source_blend, g_gpu_device->GetFeatures().framebuffer_fetch); @@ -164,6 +167,7 @@ bool PostProcessing::GLSLShader::CompilePipeline(GPUTexture::Format format, u32 return false; } + m_output_format = format; return true; } diff --git a/src/util/postprocessing_shader_glsl.h b/src/util/postprocessing_shader_glsl.h index ba17ac712..be4e0200c 100644 --- a/src/util/postprocessing_shader_glsl.h +++ b/src/util/postprocessing_shader_glsl.h @@ -59,6 +59,7 @@ private: std::unique_ptr m_pipeline; std::unique_ptr m_sampler; + GPUTexture::Format m_output_format = GPUTexture::Format::Unknown; }; } // namespace PostProcessing \ No newline at end of file