@@ -17,7 +17,7 @@ A root signature can be specified in HLSL as a `string
17
17
The string contains a collection of comma-separated clauses that describe root
18
18
signature constituent components.
19
19
20
- There are two mechanisms to compile an HLSL root signature. First, it is
20
+ There are three mechanisms to compile an HLSL root signature. First, it is
21
21
possible to attach a root signature string to a particular shader via the
22
22
RootSignature attribute (in the following example, using the main entry
23
23
point):
@@ -41,7 +41,7 @@ point):
41
41
" addressU = TEXTURE_ADDRESS_CLAMP, " \
42
42
" filter = FILTER_MIN_MAG_MIP_LINEAR )"
43
43
44
- [RootSignature(MyRS )]
44
+ [RootSignature(RS )]
45
45
float4 main(float4 coord : COORD) : SV_Target
46
46
{
47
47
…
@@ -50,7 +50,27 @@ point):
50
50
The compiler will create and verify the root signature blob for the shader and
51
51
embed it alongside the shader byte code into the shader blob.
52
52
53
- The other mechanism is to create a standalone root signature blob, perhaps to
53
+ The second mechanism is using -rootsig-define option to specify macro define of
54
+ the root signature string.
55
+
56
+ .. code-block ::
57
+
58
+ #define RS "…"
59
+
60
+ float4 main(float4 coord : COORD) : SV_Target
61
+ {
62
+ …
63
+ }
64
+
65
+ Instead of adding the root signature attribute, the root signature macro define
66
+ is passed to the compiler with -rootsign-define.
67
+
68
+ .. code-block :: sh
69
+
70
+ dxc.exe -T ps_6_0 MyRS1.hlsl -rootsig-define RS -Fo MyRS1.fxo
71
+
72
+
73
+ The third mechanism is to create a standalone root signature blob, perhaps to
54
74
reuse it with a large set of shaders, saving space. The name of the define
55
75
string is specified via the usual -E argument. For example:
56
76
0 commit comments