Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

OMSetRenderTargets per Command List?

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

Let's say I have three command lists, A B and C.  They are guaranteed to be submitted in order.  If I call OMSetRenderTargets on list A, can I then ignore calling it on the B and C lists and assume they will be writing to the same render target?

Share this post


Link to post
Share on other sites
Advertisement
Each separate command list should be seen as having it's own completely separate state and setup. You should call it from each individually. You'll also need to set your description heaps, etc., (even if they're the same) on each.

Share this post


Link to post
Share on other sites

Is it a necessity per list though?  Wouldn't putting in a fence to ensure the correct setup has been processed be less work for the GPU than calling OMSetRenderTargets, RSSetViewports, and RSSetScissorRects for every list?  To clarify, I'm making those calls per list now, but I'm just wondering if there's a better way to do it...

Share this post


Link to post
Share on other sites

GPUs aren't necessarily as stateful as your mental model might indicate. Each command list command isn't necessarily something that's executed by the GPU. It might simply be storing some CPU-side state which will be used by the driver when recording a subsequent command. In that case, since command lists can be recorded in parallel and submitted out-of-order, these types of commands need to be present in every command list.

Rather than try to pin hardware to a particular model where some states must be set by hardware commands, and others may be CPU-side tracking, D3D12 requires all command list state to fit into a model that supports either.

Share this post


Link to post
Share on other sites

I recommend splitting command lists into multiple render passes or generic object passes to reduce state overhead. And maybe if you feel that the command lists are too small and should be combined, then probably they should be just one command list. 

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!