From a837bc291dce71a69afbdfe5d2ff4158f1af3158 Mon Sep 17 00:00:00 2001 From: Lveyou <1339484752@qq.com> Date: Sun, 21 Jun 2026 17:44:46 +0800 Subject: [PATCH] =?UTF-8?q?*=202d=E7=BB=98=E5=88=B6=E9=97=AA=E7=BC=A9?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dl/vk/dl_vk.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dl/vk/dl_vk.cpp b/dl/vk/dl_vk.cpp index 21bfa3e4..d6aca26d 100644 --- a/dl/vk/dl_vk.cpp +++ b/dl/vk/dl_vk.cpp @@ -5952,8 +5952,7 @@ void VK::Update() if (num_vertex_need > canvas->_numVertex[_currentFrame]) {// 重建当前frame(等待GPU完成) - constexpr auto TIME_OUT = std::numeric_limits::max(); - vkWaitForFences(_device, 1, &_allFenceInFlight[_currentFrame], VK_TRUE, TIME_OUT); + vkWaitForFences(_device, 1, &_allFenceInFlight[_currentFrame], VK_TRUE, UINT64_MAX); vkDestroyBuffer(_device, canvas->_vertexBuffer[_currentFrame], nullptr); vkFreeMemory(_device, canvas->_vertexBufferMemory[_currentFrame], nullptr); canvas->_numVertex[_currentFrame] = num_vertex_need * 2; @@ -5988,7 +5987,8 @@ void VK::Update() dcl_x->_listSpr.push_back(spr); } } - + // 等待当前帧完成后再写入 + vkWaitForFences(_device, 1, &_allFenceInFlight[_currentFrame], VK_TRUE, UINT64_MAX); Vertex2D* vertex;// 顶点内存 vkMapMemory(_device, canvas->_vertexBufferMemory[_currentFrame], 0, canvas->_vertexBufferSize[_currentFrame], 0, (void**)&vertex);