-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to do D3D12-style command buffer management in Vulkan #15
Comments
I would also note that there's interaction between command buffer management and semaphore management here - timeline semaphores kind of round out the whole package if you want to truly emulate the same style of command buffer management developers are used to in D3D12. These pieces can be written separately, but eventually should be part of the same guide section. |
One additional thing to mention which I kind of didn't call out explicitly, in the same way that in D3D12 you would need to call ID3D12CommandAllocator::Reset to reclaim memory, you should be calling vkResetCommandPool - ideally once per frame. If we're going to document this properly as command buffer management advice, we should be clear to include that. Not doing this can result in an eventual OOM condition. See https://docs.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles for useful info on how d3d12 command lists are used. |
One other comment is that this doesn't represent the only way you might use command lists in D3D12 - it seems perfectly possible to use them in the same way as Vulkan. This is specifically addressing a common pattern in D3D12 applications where the command lists are created and submitted on a per-frame basis, but then they are individually reset to use a new command allocator - this indicates the best way to accomplish that. |
Might be worth a whole chapter on moving to Vulkan if you're coming form D3D12? |
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:
It would be useful to turn this porting advice into a section of the Vulkan-Guide, possibly alongside other porting advice.
The text was updated successfully, but these errors were encountered: