Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.12k stars 513 forks source link

Command buffers section on VkCommandPoolCreateInfo flag set to 0. #182

Closed Bambofy closed 4 years ago

Bambofy commented 4 years ago

Hi, https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Command_buffers here you say that the flags field is optional however Vulkan technically has no optional fields.

See https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VkCommandPoolCreateInfo

Valid Usage (implicit) flags must be a valid combination of VkCommandPoolCreateFlagBits values

From the "Vulkan Programming Guide" book, it suggests to set both VK_COMMAND_POOL_CREATE_TRANSIENT_BIT and VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT

Krenodeno commented 4 years ago

You can zero the flag parameter : VkCommandPoolCreateFlags is a bitmask type for setting a mask of zero or more VkCommandPoolCreateFlagBits.

Bambofy commented 4 years ago

You can zero the flag parameter : VkCommandPoolCreateFlags is a bitmask type for setting a mask of zero or more VkCommandPoolCreateFlagBits.

Yeah it says you can set it to zero but the book says you shouldn't, you should set both transient and reset command bits instead

Overv commented 4 years ago

VK_COMMAND_POOL_CREATE_TRANSIENT_BIT is not applicable since the command buffers in the tutorial are not short-lived and neither is VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT because the command buffers are never reset.

Bambofy commented 4 years ago

VK_COMMAND_POOL_CREATE_TRANSIENT_BIT is not applicable since the command buffers in the tutorial are not short-lived and neither is VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT because the command buffers are never reset.

ah i think i misundertood the api, it says any valid combination of bits, 0 is a valid combination :)