-
Notifications
You must be signed in to change notification settings - Fork 17
[0029] Proposal: Add Root Signature related driver options #320
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
Merged
+197
−0
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
de7e82c
[0002] Proposal: Add Root Signature related driver options
inbelic b5dd0fc
review: mention command line define
inbelic 5859de6
review: update wording
inbelic 7c5faf0
review: clarify 'shadow'
inbelic 50d458a
review: clarify what is validated
inbelic 7281f35
self-review: use consistent language
inbelic 351421b
self-review: add missed /Frs option
inbelic 2ff6d16
self-review: properly document `setrootsignature`
inbelic 75029be
review: fix wording
inbelic 0f6cc2f
review: clarify about use -E
inbelic 0a9f430
review: fix typo
inbelic 93ac674
reivew: clarify validations done in rootsig-define and setrootsignature
inbelic d9f67e4
review: add information about `dumpbin` into heading section
inbelic c9223ce
review: clarify input in `setrootsignature`
inbelic b51e3fa
review: note for Frs
inbelic 7008429
self-review: clean-up for consistent language
inbelic adfe504
review: update from design meeting notes
inbelic 9c5ee97
review: move to separate proposal
inbelic 6f78d84
add footer
inbelic ad18e8c
self-review: update non-compile options from design meeting
inbelic d9aae3a
review: fix small errors
inbelic c21a2d3
number proposal
inbelic 667fd2e
add proposal number in file
inbelic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
<!-- {% raw %} --> | ||
|
||
# Root Signature Driver Options | ||
|
||
* Proposal: [NNNN](NNNN-root-signture-driver-options.md) | ||
* Author(s): [Finn Plummer](https//github.com/inbelic) | ||
* Status: **Accepted** | ||
* Impacted Project(s): Clang | ||
|
||
## Introduction | ||
|
||
A user can compile and use a root signature for a shader using a variety of | ||
different command line options. This section lists the options available in DXC | ||
that will be carried forward to Clang and their expected behaviour. | ||
|
||
Options implemented in Clang follow the guiding principle to validate as much | ||
as possible on the smallest set of root signatures. Practically, this means | ||
that if a root signature will not be used, then it will not be parsed or | ||
validated. | ||
|
||
DXC also provided numerous options that (alongside `-dumpbin`) were intended to | ||
to modify the compiled DXIL Container with respect to the root signature (RTS0) | ||
part. It has been decided that these options will not be implemented in Clang | ||
as a driver option. Instead they will have their functionality implemented | ||
separately within an object manipulation tool. | ||
|
||
## Compilation Options | ||
|
||
### Option `-force-rootsig-ver` | ||
|
||
When compiling a shader with a root signature, this option overrides the root | ||
signature version used, where the default is `rootsig_1_1`. | ||
|
||
Usage: | ||
|
||
``` | ||
-force-rootsig-ver rootsig_1_0 | ||
-force-rootsig-ver rootsig_1_1 | ||
``` | ||
|
||
Behaviour: | ||
|
||
- Validation logic that is specific to the version will be followed | ||
- The serialized RTS0 format will be compliant with specified version | ||
|
||
### Option `-rootsig-define`: | ||
|
||
Overrides the root signature attribute for the entry function to be the root | ||
signature defined by the given macro expansion. | ||
|
||
Usage: | ||
|
||
Given a defined macro either provided in the source file | ||
(`#define RS "CBV(b0)"`), or, as a command line define | ||
(`-D RS="CBV(b0)"`) | ||
|
||
``` | ||
-rootsig-define RS | ||
``` | ||
|
||
Behaviour: | ||
|
||
- If the entry function does not have a root signature attribute, it will use | ||
the one defined by the macro expansion | ||
- If the entry function has a root signature attribute, it will overwrite to | ||
use the one defined by the macro expansion | ||
|
||
_Note_: Behaviour differs from DXC as it will not parse the function's root | ||
signature attribute, if it exists | ||
|
||
### Target Root Signature Version | ||
|
||
Compiles the "entry" root signature, specified by the given macro expansion, to | ||
a DXIL Container with just the (version specific) RTS0 part. | ||
|
||
Usage: | ||
|
||
Given a defined macro in the source file (`#define RS "CBV(b0)"`) | ||
|
||
``` | ||
-T <root signature version> -E <entry root signature> | ||
-T <root signature version> -E <entry root signature> -D <entry root signature>="..." | ||
-T rootsig_1_0 -E RS /Fo RS.bin | ||
-T rootsig_1_1 -E RS /Fo RS.bin | ||
``` | ||
|
||
Behaviour: | ||
|
||
- Parse and perform syntactic validations of "entry" root signature | ||
- Perform the non-resource binding sub-set of validations | ||
- Produces a DXIL container with just the RTS0 part | ||
|
||
_Note_: It is not possible to use `-rootsig-define` to overwrite which root | ||
signature will be used as the "entry" root signature, because this is specified | ||
using the `-E` option when compiling directly to a root signature target. | ||
|
||
_Note_: It is possible to specify the root signature using the `-D` option. | ||
This then should not require providing a source file. DXC still requires an | ||
input file, so it will be left as an implementation detail of whether or not it | ||
is feasible to have an optional source file. | ||
|
||
### Option `-Qstrip_rootsignature` | ||
|
||
Omits the root signature part (RTS0) from the produced DXIL Container. | ||
|
||
Usage: | ||
|
||
``` | ||
-Qstrip_rootsignature | ||
``` | ||
|
||
Behaviour: | ||
|
||
- Parse and perform validations of used root signature | ||
- Produces the DXIL container with the RTS0 omitted | ||
|
||
_Note_: Behaviour differs from DXC as it will perform resource binding | ||
validations since this information is available. | ||
|
||
### Option `/Frs` | ||
|
||
Specifies to compile the shader as normal but will also output the RTS0 part | ||
into a separate DXIL Container. | ||
|
||
Usage: | ||
|
||
``` | ||
/Frs <DXIL Container> | ||
``` | ||
|
||
Behaviour: | ||
|
||
- Creates a separate compiler action to output a DXIL Container with just RTS0 | ||
part into the file specified. | ||
- Parses and validates the entry function's root signature. | ||
|
||
## Object Maniupulation Options | ||
|
||
For all of the following options it is defined that the produced container | ||
will have its contents re-hashed for validility. When describing the option | ||
usage, it is assumed that the DXIL Container to be modified is the input file. | ||
This will be referred to as the input DXIL Container. The argument to the | ||
option is referred to as the provided DXIL Container. | ||
|
||
#### Option `-setrootsignature` | ||
|
||
Produce a copy of input DXIL Container with the RTS0 part of provided DXIL | ||
Container. Perform resource binding validations on produced DXIL Container. | ||
|
||
Usage: | ||
|
||
``` | ||
-setrootsignature <DXIL Container with RTS0> | ||
``` | ||
|
||
Behaviour: | ||
|
||
- Performs resource binding validations with input shader bytecode and RTS0 | ||
of provided DXIL Container | ||
- Produces a copy of input DXIL Container with the RTS0 part of provided DXIL | ||
Container | ||
- Requires the provided DXIL Container to be a valid DXIL container with an | ||
RST0 part | ||
|
||
#### Option `-extractrootsignature` | ||
|
||
Produce a DXIL Container containing only the input DXIL Container RTS0 part. | ||
|
||
Usage: | ||
|
||
``` | ||
-extractrootsignature /Fo <DXIL Container> | ||
``` | ||
|
||
Behaviour: | ||
|
||
- As described above. | ||
|
||
#### Option `-verifyrootsignature` | ||
|
||
Perform resource binding validations of input DXIL Container with the RTS0 part | ||
of provided DXIL Container. | ||
|
||
Usage: | ||
|
||
``` | ||
-verifyrootsignature <DXIL Container with RTS0> | ||
``` | ||
|
||
Behaviour: | ||
|
||
- Performs resource binding validations with input shader bytecode and RTS0 | ||
of provided DXIL Container | ||
- Requires the provided DXIL Container to be a valid DXIL container with an | ||
RST0 part | ||
|
||
## Acknowledgments (Optional) | ||
inbelic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<!-- {% endraw %} --> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.