Jump to content
  • Advertisement
Sign in to follow this  
piluve

DX12 Unpopulated root signatures.

Recommended Posts

Hi,

Quote

There is an additional restriction for Tier 1 hardware that applies to all heaps, and to Tier 2 hardware that applies to CBV and UAV heaps, that all descriptor heap entries covered by descriptor tables in the root signature must be populated with descriptors by the time the shader executes, even if the shader (perhaps due to branching) does not need the descriptor. There is no such restriction for Tier 3 hardware. One mitigation for this restriction is the diligent use of Null descriptors.

(from: https://msdn.microsoft.com/en-us/library/windows/desktop/dn899109(v=vs.85).aspx#Null_descriptors

Does this mean that, I need to declare root signatures with all the slots even if I don't use them, or does it mean that every entry in the root signature must be populated? 

Sorry if I it is too obvious but I've read things related to this from different sources and I'm a bit confused :S.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

The root signature needs to declare all data your shaders expect. If your shaders don't expect any data, you can simply use a blank root signature. The root signature is simply like a parameter list (function signature) for your shader pipeline:

RenderTarget ExecutePipeline(RootSignature sig); // obviously this is not a real representation

 

Share this post


Link to post
Share on other sites
1 minute ago, iedoc said:

The root signature needs to define all data your shaders expect. If your shaders don't expect any data, you can simply use a blank root signature. The root signature is simply like a parameter list (function signature) for your shader pipeline:


void ExecutePipeline(RootSignature sig);

 

Yeah I get that, but what about that restriction? It forces you to make a root signature with lets say 14 CBV? Or it just forces you to make sure each declared CBV has a view?

Share this post


Link to post
Share on other sites

It's just saying, if your shaders expect 14 cbv's, you're root signature needs to represent that.

Share this post


Link to post
Share on other sites

Alright, my confusion was, that I though that it will force to have 14CBV declared in the root signature and fill the unused with null views. 

Share this post


Link to post
Share on other sites
Quote

all descriptor heap entries covered by descriptor tables in the root signature must be populated with descriptors by the time the shader executes

this is saying that all the descriptors that a descriptor table points to (the table which the root signature is pointing to), MUST exist before your shader runs

Nope, you don't need to fill out anything that your not using

Share this post


Link to post
Share on other sites

For Tier 2 your entire shader-visible UAV and CBV descriptor tables need to have valid descriptors in them. So if your root signature specifies a descriptor table with 8 UAV's and your shader only uses 4, then there still needs to be 8 valid UAV descriptors in the table that you specify with SetGraphicsRootDescriptorTable. NULL descriptors count as "valid" in this case, so you can fill up the rest of your table with NULL descriptors if you want. 

The validation layer will complain at you if you mess this up, but unfortunately it will only do this if you run on Tier 2 hardware.  There's not a whole lot of DX12-capable Tier 2 hardware out there ever since Nvidia upgraded their Maxwell and Pascal GPU's to Tier 3.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!