PostProcessing/GLSL: Skip recompile on target size change

This is specific to reshade.
pull/3590/head
Stenzek 1 week ago
parent 41b8f2bf77
commit a49d0b665f
No known key found for this signature in database

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

@ -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
Loading…
Cancel
Save