命令缓冲池需要,隐式重置。
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2019-2025, Sascha Willems
|
/* Copyright (c) 2019-2025, Sascha Willems
|
||||||
* Copyright (c) 2024-2025, Arm Limited and Contributors
|
* Copyright (c) 2024-2025, Arm Limited and Contributors
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
@@ -644,6 +644,9 @@ void ApiVulkanSample::create_command_pool()
|
|||||||
{
|
{
|
||||||
VkCommandPoolCreateInfo command_pool_info = {};
|
VkCommandPoolCreateInfo command_pool_info = {};
|
||||||
command_pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_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();
|
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));
|
VK_CHECK(vkCreateCommandPool(get_device().get_handle(), &command_pool_info, nullptr, &cmd_pool));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user