dzn_descriptor_heap_pool_reset(&cmdbuf->cbv_srv_uav_pool);
dzn_descriptor_heap_pool_reset(&cmdbuf->sampler_pool);
- if (cmdbuf->vk.state == MESA_VK_COMMAND_BUFFER_STATE_RECORDING)
+ if (cmdbuf->vk.state == MESA_VK_COMMAND_BUFFER_STATE_RECORDING &&
+ cmdbuf->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY)
ID3D12GraphicsCommandList1_Close(cmdbuf->cmdlist);
vk_command_buffer_reset(&cmdbuf->vk);
- ID3D12CommandAllocator_Reset(cmdbuf->cmdalloc);
+ if (cmdbuf->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY)
+ ID3D12CommandAllocator_Reset(cmdbuf->cmdalloc);
}
static uint32_t
goto out;
}
- if (FAILED(ID3D12Device1_CreateCommandAllocator(device->dev, type,
- &IID_ID3D12CommandAllocator,
- (void **)&cmdbuf->cmdalloc))) {
- result = vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
- goto out;
- }
+ if (cmdbuf->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY) {
+ if (FAILED(ID3D12Device1_CreateCommandAllocator(device->dev, type,
+ &IID_ID3D12CommandAllocator,
+ (void **)&cmdbuf->cmdalloc))) {
+ result = vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
+ goto out;
+ }
- if (FAILED(ID3D12Device4_CreateCommandList1(device->dev, 0, type,
- D3D12_COMMAND_LIST_FLAG_NONE,
- &IID_ID3D12GraphicsCommandList1,
- (void **)&cmdbuf->cmdlist))) {
- result = vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
- goto out;
- }
+ if (FAILED(ID3D12Device4_CreateCommandList1(device->dev, 0, type,
+ D3D12_COMMAND_LIST_FLAG_NONE,
+ &IID_ID3D12GraphicsCommandList1,
+ (void **)&cmdbuf->cmdlist))) {
+ result = vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
+ goto out;
+ }
- (void)ID3D12GraphicsCommandList_QueryInterface(cmdbuf->cmdlist, &IID_ID3D12GraphicsCommandList8, (void **)&cmdbuf->cmdlist8);
- (void)ID3D12GraphicsCommandList_QueryInterface(cmdbuf->cmdlist, &IID_ID3D12GraphicsCommandList9, (void **)&cmdbuf->cmdlist9);
+ (void)ID3D12GraphicsCommandList_QueryInterface(cmdbuf->cmdlist, &IID_ID3D12GraphicsCommandList8, (void **)&cmdbuf->cmdlist8);
+ (void)ID3D12GraphicsCommandList_QueryInterface(cmdbuf->cmdlist, &IID_ID3D12GraphicsCommandList9, (void **)&cmdbuf->cmdlist9);
+ }
cmdbuf->type = type;
cmdbuf->valid_sync = cmd_buffer_valid_sync[type];
{
VK_FROM_HANDLE(dzn_cmd_buffer, cmdbuf, commandBuffer);
vk_command_buffer_begin(&cmdbuf->vk, info);
- ID3D12GraphicsCommandList1_Reset(cmdbuf->cmdlist, cmdbuf->cmdalloc, NULL);
+ if (cmdbuf->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY)
+ ID3D12GraphicsCommandList1_Reset(cmdbuf->cmdlist, cmdbuf->cmdalloc, NULL);
return vk_command_buffer_get_record_result(&cmdbuf->vk);
}