KhronosGroup / KhronosGroup/Vulkan-Guide

Document how to do D3D12-style command buffer management in Vulkan

Open
#15 4 comments 4 reactions 0 assignees View on GitHub
documentation
Dominant language
Makefile
Stars
2.3k
Forks
196
PR merge metrics
No merged PRs in 30d

Description

There's a particular usage pattern for dynamically recorded command buffers which DX12 applications make use of DX12's ability to free-associate command buffers with command allocators, which is not how things naturally work in Vulkan.

Whilst this might not be the ideal method for managing command buffers in all cases, it works, and is natural for anyone porting D3D12 content.

After discussion in the Vulkan WG, we agreed that the following advice is the right way to achieve the same in Vulkan, with no expected perf implications vs DX12:

- Allocate command pools with VK_COMMAND_POOL_CREATE_TRANSIENT_BIT
- Treat VkCommandPool objects the same as ID3D12CommandAllocator objects
- I.e. they are externally synchronized command allocators
- Don't pre-allocate command buffers
- Allocate command buffers when you want to begin recording, then begin them
- When the command buffer is no longer in use, free the command buffer
- Ideally along with all others associated with the same pool

It would be useful to turn this porting advice into a section of the Vulkan-Guide, possibly alongside other porting advice.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing Vulkan-Guide structure and locating any porting-advice section where this topic belongs. Add a section covering the command-pool and command-buffer management guidance listed in the issue; done means the D3D12-to-Vulkan usage pattern is documented clearly in the guide.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.