In Microsoft Direct3D 12, most graphics pipeline state is set within a command list using the ID3D12PipelineState object. The initial pipeline state for the command list. Also, note that this API is not free-threaded and therefore can't be called on the same allocator at the same time from multiple threads. But before doing so, the app must make sure that the GPU is no longer executing any command lists which are associated with the allocator otherwise, the call will fail. This allows the allocator to be reused for new commands, but won't reduce its underlying size. To reclaim the memory allocated by a command allocator, an app calls ID3D12CommandAllocator::Reset. A given allocator can be associated with no more than one currently recording command list at a time, though one command allocator can be used to create any number of GraphicsCommandList objects. When creating a command list, the command list type of the allocator, specified by D3D12_COMMAND_LIST_TYPE, must match the type of command list being created. The command allocator is created by calling CreateCommandAllocator. ID3D12CommandAllocatorĪ command allocator allows the app to manage the memory that is allocated for command lists. It can be a direct command list, a bundle, a compute command list, or a copy command list. The D3D12_COMMAND_LIST_TYPE enumeration indicates the type of command list that is being created. ID3D12Device::CreateCommandList takes the following parameters as input: D3D12_COMMAND_LIST_TYPE This avoids the inefficiency of creating a list with an allocator and PSO but not using them.
Use ID3D12Device4::CreateCommandList1 to create a closed command list, rather than creating a new list and immediately closing it. Creating command listsĭirect command lists and bundles are created by calling ID3D12Device::CreateCommandList or ID3D12Device4::CreateCommandList1. There are different restrictions for creating and executing bundles and direct command lists, and these differences are noted throughout this topic.
Typically though, the build up of API calls into bundles, and API calls and bundles into command lists, and command lists into a single frame, is shown in the following diagram, noting the reuse of Bundle 1 in Command list 1 and Command list 2, and that the API method names in the diagram are just as examples, many different API calls can be used. However, a command list can be executed multiple times (as long as the application ensures that the previous executions have completed before submitting new executions).
Command lists, on the other hand, are typically executed only a single time. Bundles are designed to be used and re-used any number of times.
#Eyespy command list driver
At bundle creation time, the driver will perform as much pre-processing as is possible to make these cheap to execute later. The purpose of bundles is to allow apps to group a small number of API commands together for later execution.
Command lists and bundles both allow apps to record drawing or state-changing calls for later execution on the graphics processing unit (GPU).īeyond command lists, the API exploits functionality present in GPU hardware by adding a second level of command lists, which are referred to as bundles. This topic describes recording command lists and bundles in Direct3D 12 apps.