命令缓冲池需要,隐式重置。

This commit is contained in:
xsl
2025-09-17 23:34:58 +08:00
parent 0d90c33380
commit 8e721b9c42
+4 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2025, Sascha Willems
/* Copyright (c) 2019-2025, Sascha Willems
* Copyright (c) 2024-2025, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
@@ -644,6 +644,9 @@ void ApiVulkanSample::create_command_pool()
{
VkCommandPoolCreateInfo command_pool_info = {};
command_pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
// --- 新增:设置允许重置命令缓冲区的标志 ---
command_pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
// --- 新增结束 ---
command_pool_info.queueFamilyIndex = get_device().get_queue_by_flags(VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, 0).get_family_index();
VK_CHECK(vkCreateCommandPool(get_device().get_handle(), &command_pool_info, nullptr, &cmd_pool));
}