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.

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 on other sites

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 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 on other sites

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

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 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 on other sites

Alright thanks for clarifying it

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.

Create an account

Register a new account

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 13
• 9
• 12
• 9
• Forum Statistics

• Total Topics
631437
• Total Posts
3000063
×