From ce4647d9909ce1a26c17cb2fd843fe8037ab1f22 Mon Sep 17 00:00:00 2001 From: LunaDL <91587464+EnzoDLofi@users.noreply.github.com> Date: Thu, 26 Nov 2026 23:00:34 -0400 Subject: [PATCH] Fix DD FrameGen scratch resource leak on resize --- app/src/main/cpp/framegen/ddfg/record_impl.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/cpp/framegen/ddfg/record_impl.inc b/app/src/main/cpp/framegen/ddfg/record_impl.inc index f366d9a9c4..7f343fdffb 100644 --- a/app/src/main/cpp/framegen/ddfg/record_impl.inc +++ b/app/src/main/cpp/framegen/ddfg/record_impl.inc @@ -261,6 +261,10 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur const Pipe& expandP = m4 ? pExpandM4_ : pExpand_; if (!g_scratch.built || g_scratch.builtFor.width != extent_.width || g_scratch.builtFor.height != extent_.height) { + if (g_scratch.built) { + dd_->DeviceWaitIdle(device_); + destroyScratch(dd_, device_, descPool_); + } ensureScratch(this, dd_, device_, memProps_, descPool_, linear_, extent_, pyrA_, pyrB_, pyrAs_, flowLvl_, flowExpA_, flowExpB_, pLuma_, pDown_, flowP, expandP, pSynth_, pGmReduce_, pGmPrewarp_,