diff --git a/filament/src/RenderPass.h b/filament/src/RenderPass.h index c3c3e55630..6abe578eb8 100644 --- a/filament/src/RenderPass.h +++ b/filament/src/RenderPass.h @@ -280,6 +280,7 @@ public: Command const* begin() const noexcept { return mCommandBegin; } Command const* end() const noexcept { return mCommandEnd; } + bool empty() const noexcept { return begin() == end(); } // This is the main function of this class, this appends commands to the pass using // the current camera, geometry and flags set. This can be called multiple times if needed. diff --git a/filament/src/Renderer.cpp b/filament/src/Renderer.cpp index 55e3780e05..7d955dacf0 100644 --- a/filament/src/Renderer.cpp +++ b/filament/src/Renderer.cpp @@ -497,7 +497,7 @@ void FRenderer::renderJob(ArenaScope& arena, FView& view) { // the color pass + refraction + color-grading as subpass if needed // this cancels the colorPass() call above if refraction is active. - if (view.isScreenSpaceRefractionEnabled()) { + if (view.isScreenSpaceRefractionEnabled() && !pass.empty()) { colorPassOutput = refractionPass(fg, config, colorGradingConfigForColor, pass, view); }