Skip to content

panvk: add secondary command buffers support

sin3point14 requested to merge sin3point14/mesa:panvk-exec-cmd into main

The first part of this MR adds generic support for software based command buffer record/replay. This greatly simplifies implementation of secondary command buffer support on hardware where duplicating a command stream is not as easy as copying command stream BOs.

That's the case on Mali GPUs where the commands are passed through a chained-list and references other descriptors through pointers, thus forcing us to add an extra pointer relocation step after the copy if we want to have things working properly. Not to mention that secondary command buffers that are executed inside a render pass depend on descriptors that are only emitted by the primary command buffer, which requires extra patching. We might end up implementing this more complex (but also probably more efficient) solution at some point, but in the meantime, the SW-based approach is doing the job.

Note that we plan to re-use the common bits for the dozen driver (Vulkan-on-D3D12) since D3D12 has no way to easily copy an ID3D12CommandList.

/cc @jekstrand @lfrb @tomeu

Edited by Boris Brezillon

Merge request reports