* 2d绘制闪缩问题修正

This commit is contained in:
2026-06-21 17:44:46 +08:00
parent 733f56d1e9
commit a837bc291d
+3 -3
View File
@@ -5952,8 +5952,7 @@ void VK::Update()
if (num_vertex_need > canvas->_numVertex[_currentFrame])
{// 重建当前frame(等待GPU完成)
constexpr auto TIME_OUT = std::numeric_limits<uint64_t>::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);