• Advertisement
Sign in to follow this  

[D3D12] m_commandList->SetDescriptorHeaps

This topic is 713 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

Microsoft documentation states that changing the heap can cause the GPU to flush, but it is not very clear on what causes the GPU flush.  My question is if I have two different command list's and I call

m_commandList->SetDescriptorHeaps(_countof(ppHeaps), ppHeaps);

 on both command lists but they both use the same exact heap, does it cause a GPU flush?  If it does, then what is the best practice to not flush to GPU?  Only use one command list and pass it to all the render methods?

Share this post


Link to post
Share on other sites
Advertisement
I am writing on the plane. Correct me if I am wrong. You could set descriptor heap on your command lists during app initialization stage. Calling Reset on the command list will not unbind initially set descriptor heap. Again, correct me if I am wrong.

Share this post


Link to post
Share on other sites

I didn't think that the currently set descriptor heap would persist through different command lists? Doesn't each command list need to set its heaps?

Share this post


Link to post
Share on other sites

I am writing on the plane. Correct me if I am wrong. You could set descriptor heap on your command lists during app initialization stage. Calling Reset on the command list will not unbind initially set descriptor heap. Again, correct me if I am wrong.

You set the descriptor heap per frame, so pretty sure this is wrong but I will test it.  EDIT: Tested and does not work.

 

I didn't think that the currently set descriptor heap would persist through different command lists? Doesn't each command list need to set its heaps?

Descriptor heap does NOT persist through command lists.  Each command list DOES need a heap. 

 

Microsoft documentation states that changing the heap can cause the GPU to flush, but it is not very clear on what causes the GPU flush.  My question is if I have two different command list's and I call

m_commandList->SetDescriptorHeaps(_countof(ppHeaps), ppHeaps);

 on both command lists but they both use the same exact heap, does it cause a GPU flush?  If it does, then what is the best practice to not flush to GPU?  Only use one command list and pass it to all the render methods?

 

It is obvious when debugging with Diagnostics that the descriptor heap from both command lists is different so obviously it is flushing the first heap.  Looks like the only way to not flush the GPU is to use the command list all the way through all Render methods.

Share this post


Link to post
Share on other sites
When you submit multiple command lists in a single Execute call, the driver may walk the first commands of subsequent command lists and patch them to elide flushes. However if you submit your command lists individually, each one will cause a flush so the potential flush from SetDescriptorHeaps is a no-op and not a concern.

Share this post


Link to post
Share on other sites

When you submit multiple command lists in a single Execute call, the driver may walk the first commands of subsequent command lists and patch them to elide flushes. However if you submit your command lists individually, each one will cause a flush so the potential flush from SetDescriptorHeaps is a no-op and not a concern.


I appreciate the feedback and the original question maybe should have been worded differently because execute is being run on both command lists which flushes the gpu. I have tested it with a sample application and see it flushing.

Share this post


Link to post
Share on other sites

Microsoft documentation states that changing the heap can cause the GPU to flush, but it is not very clear on what causes the GPU flush.  My question is if I have two different command list's and I call

m_commandList->SetDescriptorHeaps(_countof(ppHeaps), ppHeaps);

 on both command lists but they both use the same exact heap, does it cause a GPU flush?  If it does, then what is the best practice to not flush to GPU?  Only use one command list and pass it to all the render methods?

Hi, cpyburn78

 

Can you please tell me where in the SDK doc it's been addressed? I just couldn't find any relevant info in the page of "ID3D12GraphicsCommandList::SetDescriptorHeaps method" and I'm lazy so please lead me to your page.

Share this post


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

  • Advertisement