We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c669e3 commit eda65a6Copy full SHA for eda65a6
src/util/postprocessing.cpp
@@ -429,8 +429,10 @@ PostProcessing::Chain::~Chain() = default;
429
430
GPUTexture* PostProcessing::Chain::GetTextureUnusedAtEndOfChain() const
431
{
432
- return (m_stages.size() % 2) ? m_output_texture.get() :
433
- (m_intermediate_texture ? m_intermediate_texture.get() : m_input_texture.get());
+ const size_t num_active_stages = std::ranges::count_if(
+ m_stages, [](const std::unique_ptr<Shader>& shader) { return (shader && shader->IsEnabled()); });
434
+ return (num_active_stages % 2) ? m_output_texture.get() :
435
+ (m_intermediate_texture ? m_intermediate_texture.get() : m_input_texture.get());
436
}
437
438
bool PostProcessing::Chain::IsActive() const
0 commit comments