Jump to content
  • Advertisement
Sign in to follow this  
Mr_Fox

DX12 Overhead of SetXXXRootSignature

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

Hey Guys,

 

IIRC, dx12 rootsignature kinda define the layout of GPU memory of intended usage, so it seems ideally, we should only set rootsignature once during program startup? However, that require all you passes need a global knowledge about the memory layout of all other passes, which doesn't sound like a good design strategy (or you may need a delegate class to handle rootsignature in a post-processing fashion).   So I guess, it's should be fine to switch to different rootsignatures within on frame?  but how about the overhead of switching rootsignature for each different PSOs(like 30+ per frame)?  It will be greatly appreciated if someone could share their idea about that

 

Thanks

Share this post


Link to post
Share on other sites
Advertisement

I make a tailor made root signature for each shader (where shader == PS + VS + *S tuple), and then remove any duplicates from that list, keeping the unique set. When changing shaders, if the root sig needs to be changed, I change it.

This obviously has more CPU overhead than never changing the root sig... but I assume it's similar to the CPU side cost of switching shaders in D3D11, which isn't bad.

 

On the GPU side, I'm assuming that having a tailor made root signature will give better performance than a worst-case / works-for-every-shader root signature.

Thanks Hodgman, so I guess unlike some other APIs which could possibly stall the GPU (SetDescriptorHeap? what else, I can't remember clearly...) change rootsignature won't cause some GPU bubbles right? That said, I don't need to worry too much about my program didn't do a good job caching rootsignatures?

Share this post


Link to post
Share on other sites

I have a question about that.

 

I used to sort my passes (in a tree like structure) by root signatures then pipeline states then by resources all in one big command list.

 

Since then, I started looking at async compute to do culling of a pass while another is rendering.

 

Because fences are not part of the command list interface but rather on the queue I had to break my big command list into smaller ones (one per pass). Root signatures are undefined at the beginning of a command list so I have to re-set it for each pass' command list (even if I know they are the same for many consecutive pass).

Is there still a point to sorting by root signature in this context? Or simply sort by pipelinestate+rootsignature like hodgman seem to suggest?

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!