From 2cb19a34cf112714c66dd7749a2b7c1f24af9dda Mon Sep 17 00:00:00 2001 From: LunaDL <91587464+EnzoDLofi@users.noreply.github.com> Date: Fri, 27 Nov 2026 02:32:24 -0400 Subject: [PATCH] Skip unused FLOWREG image initialization --- app/src/main/cpp/framegen/ddfg/record_impl.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/framegen/ddfg/record_impl.inc b/app/src/main/cpp/framegen/ddfg/record_impl.inc index c6d6820142..7b43a2d7cf 100644 --- a/app/src/main/cpp/framegen/ddfg/record_impl.inc +++ b/app/src/main/cpp/framegen/ddfg/record_impl.inc @@ -367,6 +367,7 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur dd_->CmdDispatch(cmd, (e.width + 15) / 16, (e.height + 15) / 16, 1); }; auto bar = [&](FrameGen::Img& i){ barrier(cmd, i.image, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL); }; + const bool frEngaged = (cfg_.frMode != 2) && (cfg_.frIters > 0); if (!reuseFlow) { // Batch fresh-image transitions that share the same stage and access masks. @@ -387,8 +388,10 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur for (int l = flowFinest_; l < kLevels; ++l) addInitBarrier(pyrAs_[l].image); addInitBarrier(flowExpA_.image); addInitBarrier(flowExpB_.image); - addInitBarrier(flowRegA_.image); - addInitBarrier(flowRegB_.image); + if (frEngaged) { + addInitBarrier(flowRegA_.image); + addInitBarrier(flowRegB_.image); + } // The final flow level is cleared through TRANSFER_DST_OPTIMAL below; // the other levels can use the common initialization barrier. for (int l = flowFinest_; l < kLevels - 1; ++l) addInitBarrier(flowLvl_[l].image); @@ -446,7 +449,6 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur bar(flowLvl_[l]); } - const bool frEngaged = (cfg_.frMode != 2) && (cfg_.frIters > 0); if (frEngaged) { const int F = flowFinest_; const VkExtent2D fe = levelExtent(extent_, F);