Skip to content

Commit 8c7e044

Browse files
committed
Move grammar to the end.
1 parent 597cc58 commit 8c7e044

File tree

1 file changed

+74
-73
lines changed

1 file changed

+74
-73
lines changed

clang/docs/HLSL/RootSignature.rst

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,80 @@ Root signature could also used in form of StateObject like this:
7979
};
8080
8181
82+
83+
GlobalRootSignature
84+
===================
85+
86+
A GlobalRootSignature corresponds to a D3D12_GLOBAL_ROOT_SIGNATURE structure.
87+
88+
The fields consist of some number of strings describing the parts of the root signature.
89+
The string should follow Root Signature Grammar.
90+
91+
.. code-block::
92+
93+
GlobalRootSignature MyGlobalRootSignature =
94+
{
95+
"DescriptorTable(UAV(u0))," // Output texture
96+
"SRV(t0)," // Acceleration structure
97+
"CBV(b0)," // Scene constants
98+
"DescriptorTable(SRV(t1, numDescriptors = 2))" // Static index and vertex buffers
99+
};
100+
101+
102+
LocalRootSignature
103+
==================
104+
105+
A LocalRootSignature corresponds to a D3D12_LOCAL_ROOT_SIGNATURE structure.
106+
107+
Just like the global root signature subobject, the fields consist of some
108+
number of strings describing the parts of the root signature.
109+
The string should follow Root Signature Grammar.
110+
111+
.. code-block::
112+
113+
LocalRootSignature MyLocalRootSignature =
114+
{
115+
"RootConstants(num32BitConstants = 4, b1)" // Cube constants
116+
};
117+
118+
119+
SubobjectToExportsAssociation
120+
=============================
121+
122+
By default, a subobject merely declared in the same library as an export is
123+
able to apply to that export.
124+
However, applications have the ability to override that and get specific about
125+
what subobject goes with which export. In HLSL, this "explicit association" is
126+
done using SubobjectToExportsAssociation.
127+
128+
A SubobjectToExportsAssociation corresponds to a
129+
D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION structure.
130+
131+
This subobject is declared with the syntax
132+
.. code-block::
133+
134+
SubobjectToExportsAssociation Name =
135+
{
136+
SubobjectName,
137+
Exports
138+
};
139+
140+
The local/global root signature in above example could be used like this:
141+
142+
.. code-block::
143+
144+
SubobjectToExportsAssociation MyLocalRootSignatureAssociation =
145+
{
146+
"MyLocalRootSignature", // Subobject name
147+
"MyHitGroup;MyMissShader" // Exports association
148+
};
149+
SubobjectToExportsAssociation MyGlobalRootSignatureAssociation =
150+
{
151+
"MyGlobalRootSignature", // Subobject name
152+
"MyHitGroup;MyMissShader" // Exports association
153+
};
154+
155+
82156
Root Signature Grammar
83157
======================
84158

@@ -216,76 +290,3 @@ Root Signature Grammar
216290
STATIC_BORDER_COLOR : 'STATIC_BORDER_COLOR_TRANSPARENT_BLACK' |
217291
'STATIC_BORDER_COLOR_OPAQUE_BLACK' |
218292
'STATIC_BORDER_COLOR_OPAQUE_WHITE'
219-
220-
GlobalRootSignature
221-
===================
222-
223-
A GlobalRootSignature corresponds to a D3D12_GLOBAL_ROOT_SIGNATURE structure.
224-
225-
The fields consist of some number of strings describing the parts of the root signature.
226-
The string should follow Root Signature Grammar.
227-
228-
.. code-block::
229-
230-
GlobalRootSignature MyGlobalRootSignature =
231-
{
232-
"DescriptorTable(UAV(u0))," // Output texture
233-
"SRV(t0)," // Acceleration structure
234-
"CBV(b0)," // Scene constants
235-
"DescriptorTable(SRV(t1, numDescriptors = 2))" // Static index and vertex buffers
236-
};
237-
238-
239-
LocalRootSignature
240-
==================
241-
242-
A LocalRootSignature corresponds to a D3D12_LOCAL_ROOT_SIGNATURE structure.
243-
244-
Just like the global root signature subobject, the fields consist of some
245-
number of strings describing the parts of the root signature.
246-
The string should follow Root Signature Grammar.
247-
248-
.. code-block::
249-
250-
LocalRootSignature MyLocalRootSignature =
251-
{
252-
"RootConstants(num32BitConstants = 4, b1)" // Cube constants
253-
};
254-
255-
256-
SubobjectToExportsAssociation
257-
=============================
258-
259-
By default, a subobject merely declared in the same library as an export is
260-
able to apply to that export.
261-
However, applications have the ability to override that and get specific about
262-
what subobject goes with which export. In HLSL, this "explicit association" is
263-
done using SubobjectToExportsAssociation.
264-
265-
A SubobjectToExportsAssociation corresponds to a
266-
D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION structure.
267-
268-
This subobject is declared with the syntax
269-
.. code-block::
270-
271-
SubobjectToExportsAssociation Name =
272-
{
273-
SubobjectName,
274-
Exports
275-
};
276-
277-
The local/global root signature in above example could be used like this:
278-
279-
.. code-block::
280-
281-
SubobjectToExportsAssociation MyLocalRootSignatureAssociation =
282-
{
283-
"MyLocalRootSignature", // Subobject name
284-
"MyHitGroup;MyMissShader" // Exports association
285-
};
286-
SubobjectToExportsAssociation MyGlobalRootSignatureAssociation =
287-
{
288-
"MyGlobalRootSignature", // Subobject name
289-
"MyHitGroup;MyMissShader" // Exports association
290-
};
291-

0 commit comments

Comments
 (0)