Skip to content

implicitly reset command buffers when recording them #46

@buhman

Description

@buhman

The article contains this text:

The VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag lets us implicitly reset command buffers when recording them.

https://docs.vulkan.org/refpages/latest/refpages/source/VkCommandPoolCreateFlagBits.html says (emphasis added):

VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT allows any command buffer allocated from a pool to be individually reset to the initial state; either by calling vkResetCommandBuffer, or via the implicit reset when calling vkBeginCommandBuffer.

Both the code and the article use the pattern:

chk(vkResetCommandBuffer(cb, 0));
VkCommandBufferBeginInfo cbBI { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT };
chk(vkBeginCommandBuffer(cb, &cbBI));

This is not an implicit reset, because vkResetCommandBuffer was called.

Suggestion: do one of these things:

  • delete the text "The VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag lets us implicitly reset command buffers when recording them." and/or remove VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT from commandPoolCI.flags
  • delete the call to vkResetCommandBuffer

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions