Skip to content

Commit 54e5526

Browse files
committed
Update per comment.
1 parent 8c7e044 commit 54e5526

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

clang/docs/HLSL/RootSignature.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A root signature can be specified in HLSL as a `string
1717
The string contains a collection of comma-separated clauses that describe root
1818
signature constituent components.
1919

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
2121
possible to attach a root signature string to a particular shader via the
2222
RootSignature attribute (in the following example, using the main entry
2323
point):
@@ -41,7 +41,7 @@ point):
4141
" addressU = TEXTURE_ADDRESS_CLAMP, " \
4242
" filter = FILTER_MIN_MAG_MIP_LINEAR )"
4343
44-
[RootSignature(MyRS)]
44+
[RootSignature(RS)]
4545
float4 main(float4 coord : COORD) : SV_Target
4646
{
4747
@@ -50,7 +50,27 @@ point):
5050
The compiler will create and verify the root signature blob for the shader and
5151
embed it alongside the shader byte code into the shader blob.
5252

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
5474
reuse it with a large set of shaders, saving space. The name of the define
5575
string is specified via the usual -E argument. For example:
5676

0 commit comments

Comments
 (0)