PostProcessing/GLSL: Skip recompile on target size change

This is specific to reshade.
This commit is contained in:
Stenzek
2025-10-16 16:32:23 +10:00
parent 41b8f2bf77
commit a49d0b665f
2 changed files with 7 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -59,6 +59,7 @@ private:
std::unique_ptr<GPUPipeline> m_pipeline;
std::unique_ptr<GPUSampler> m_sampler;
GPUTexture::Format m_output_format = GPUTexture::Format::Unknown;
};
} // namespace PostProcessing