[D3D12] ID3D12CommandQueue::ExecuteCommandLists() execution order

Started by
4 comments, last by nbertoa 7 years, 5 months ago

Hi community

Does ID3D12CommandQueue::ExecuteCommandLists() guarantee command lists will be executed in order?

For example:


ID3D12CommandList* ppCommandLists[] = { cmdList0, cmdList1, cmdList2, cmdList3 };
m_commandQueue->ExecuteCommandLists(_countof(ppCommandLists), ppCommandLists);

cmdListN will be executed before cmdListM where N < M? MSDN documentation does not mention anything about that, so I do not know if that is undefined / GPU/driver dependant / etc.

Advertisement

All of the work submitted in a single call to ExecuteCommandLists is guaranteed to complete before the next batch of work submitted in a subsequent call, but within a single "execution group," the driver may be able to re-order commands, or maintain pipelining, as if it was a single command list.

Thanks Jesse

All of the work submitted in a single call to ExecuteCommandLists is guaranteed to complete before the next batch of work submitted in a subsequent call, but within a single "execution group," the driver may be able to re-order commands, or maintain pipelining, as if it was a single command list.

Does this mean that submitting command lists with dependencies between each other, in a single batch, is not reliable?

IIRC to ensure coherency between draw calls within a single executecommandlists batch you use resource barriers. They will flush caches and prevent pipelining and whatever is necessary to ensure coherency.

edit - here watch this:

-potential energy is easily made kinetic-

I just did a quick test. I executed 4 command lists in a single ID3D12CommandQueue::ExecuteCommandLists() and it worked properly over multiple frames.


cmdList1 = CD3DX12_RESOURCE_BARRIER::Transition(resource, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET),

cmdList2 = CD3DX12_RESOURCE_BARRIER::Transition(resource, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE),

cmdList3 = CD3DX12_RESOURCE_BARRIER::Transition(resource, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET),

cmdList4 = CD3DX12_RESOURCE_BARRIER::Transition(resource, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE),

ID3D12CommandList* cmdLists = { cmdList1, cmdList2, cmdList3, cmdList4 };
cmdQueue.ExecuteCommandLists(__countof(cmdLists), cmdLists);

This topic is closed to new replies.

Advertisement