-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[DirectX] Documenting Root Signature Binary representation #131011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 26 commits
e26ef18
4f3930a
8fae269
7ad5d2b
93116c0
e1d385a
b390cd2
46face1
6a260b3
82a7de3
b591fd8
583e29c
16e3642
3da10bd
73c645d
fcabc0e
b13609d
4525033
15babc8
5303de8
8dc983a
b013080
0bcfa6b
787c920
351e6bb
32fd3de
7dcad52
a9260e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -111,7 +111,7 @@ FXC are marked with \*. | |||||||||||||
| #. `PSV0`_ - Stores Pipeline State Validation data. | ||||||||||||||
| #. RDAT† - Stores Runtime Data. | ||||||||||||||
| #. RDEF\* - Stores resource definitions. | ||||||||||||||
| #. RTS0 - Stores compiled root signature. | ||||||||||||||
| #. `RTS0`_ - Stores compiled root signature. | ||||||||||||||
| #. `SFI0`_ - Stores shader feature flags. | ||||||||||||||
| #. SHDR\* - Stores compiled DXBC bytecode. | ||||||||||||||
| #. SHEX\* - Stores compiled DXBC bytecode. | ||||||||||||||
|
|
@@ -393,6 +393,189 @@ bit in the mask vector identifies one column of a patch constant input and a | |||||||||||||
| column of an output. A value of 1 means the output is impacted by the primitive | ||||||||||||||
| input. | ||||||||||||||
|
|
||||||||||||||
| Root Signature (RTS0) Part | ||||||||||||||
| -------------------------- | ||||||||||||||
| .. _RTS0: | ||||||||||||||
|
|
||||||||||||||
| The Root Signature data defines the shader's resource interface with Direct3D | ||||||||||||||
| 12, specifying what resources the shader needs to access and how they're | ||||||||||||||
| organized and bound to the pipeline. | ||||||||||||||
|
|
||||||||||||||
| The RTS0 part comprises three data structures: ``RootSignatureHeader``, | ||||||||||||||
| ``RootParameters`` and ``StaticSamplers``. The details of each will be described | ||||||||||||||
| in the following sections. All ``RootParameters`` will be serialized following | ||||||||||||||
| the order they were defined in the metadata representation. | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this is applicable here, but there are limits to the size of the root signatureI, specified here. Not sure if that implies that there are limits to the size of this binary format?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That can be a future validation, since this is a limitation dx12 runtime. But currently, this is not something DXC checks when serializing root signatures.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the validator (dxv) catch root signatures that are over the limit? In any case, we should make sure we have an issue to add validation that we're not allowing root signatures that go over this limit. |
||||||||||||||
|
|
||||||||||||||
| The table bellow sumarizes the data being serialized as well as it's size. The | ||||||||||||||
|
||||||||||||||
| The table bellow sumarizes the data being serialized as well as it's size. The | |
| The table below summarizes the data being serialized as well as it's size. The |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Root Descriptor Version 1.0 08 | |
| Root Descriptor Version 1.0 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you deem worthwhile, we could add the parameter type enum value. Something like:
| Root Constants | |
| Root Constants: ParameterType = 0u |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove - this sentence is redundant with the above at this point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you didn't have a chance to address this one yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, thought this was gone in the latest pr, address it in the most recent changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The tables are made of a collection of descriptor ranges. In Version 1.0, the | |
| The tables are made of an array of descriptor ranges. In Version 1.0, the |
nit: imo array is less vague and implies they are contiguous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @bogner, that using an array, imply that they have a fixed size, which is not the case for the binary representation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see what you were saying here now.
| This section also has a variable size, since it can contain multiple static | |
| samplers definitions. However, the definition is a fixed sized struct, | |
| containing 13 32-byte fields of various enum, float, and integer values. | |
| This section consists of a variable number of static sampler definitions as | |
| described in the root signature header. Each definition is 52 bytes made up of | |
| 13 32-byte fields of various enum, float, and integer values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's odd that the order here doesn't match the order of the sections later. Probably makes sense to insert the new content right before the SFI0 section rather than right after.