don't crash when refraction pass is empty

This commit is contained in:
Mathias Agopian
2021-07-07 13:36:36 -07:00
committed by Mathias Agopian
parent 7f2a189641
commit 90ee59512b
2 changed files with 2 additions and 1 deletions

View File

@@ -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.

View File

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