• Advertisement
Sign in to follow this  

[D3D12] ID3D12CommandQueue::ExecuteCommandLists() execution order

This topic is 519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

 

Share this post


Link to post
Share on other sites
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.

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

Share this post


Link to post
Share on other sites

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: 

Edited by Infinisearch

Share this post


Link to post
Share on other sites

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);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement