From a77cf25307964a61da37d51e2592bc2ea4df3097 Mon Sep 17 00:00:00 2001 From: Zhou Zhenglong Date: Thu, 5 Dec 2024 17:03:23 +0800 Subject: [PATCH] change shrinkSize position --- native/cocos/renderer/gfx-vulkan/VKDevice.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.cpp b/native/cocos/renderer/gfx-vulkan/VKDevice.cpp index b86fac5f032..82834e72a9b 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.cpp @@ -642,10 +642,6 @@ void CCVKDevice::acquire(Swapchain *const *swapchains, uint32_t count) { _gpuDescriptorSetHub->flush(); _gpuSemaphorePool->reset(); - auto *bufferPool = gpuStagingBufferPool(); - bufferPool->reset(); - bufferPool->shrinkSize(); - for (uint32_t i = 0; i < vkSwapchains.size(); ++i) { VkSemaphore acquireSemaphore = _gpuSemaphorePool->alloc(); VkResult res = vkAcquireNextImageKHR(_gpuDevice->vkDevice, vkSwapchains[i], ~0ULL, @@ -724,6 +720,7 @@ void CCVKDevice::present() { gpuFencePool()->reset(); gpuRecycleBin()->clear(); gpuStagingBufferPool()->reset(); + gpuStagingBufferPool()->shrinkSize(); if (_xr) { _xr->postGFXDevicePresent(_api); }