Skip to content

Commit 2e0dd44

Browse files
committed
fix documentation
1 parent 87fe5df commit 2e0dd44

File tree

1 file changed

+57
-9
lines changed

1 file changed

+57
-9
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7347,7 +7347,7 @@ where shaders must be compiled into a library and linked at runtime.
73477347

73487348
def HLSLLoopHintDocs : Documentation {
73497349
let Category = DocCatStmt;
7350-
let Heading = "#[loop]";
7350+
let Heading = "[loop]";
73517351
let Content = [{
73527352
The ``[loop]`` directive allows loop optimization hints to be
73537353
specified for the subsequent loop. The directive allows unrolling to
@@ -7363,15 +7363,28 @@ unroller to not unroll the loop.
73637363
...
73647364
}
73657365

7366-
See `hlsl loop extensions
7367-
<https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
7366+
.. code-block:: hlsl
7367+
7368+
[loop]
7369+
while (...) {
7370+
...
7371+
}
7372+
7373+
.. code-block:: hlsl
7374+
7375+
[loop]
7376+
do {
7377+
...
7378+
} while (...)
7379+
7380+
See `hlsl loop extensions <https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
73687381
for details.
73697382
}];
73707383
}
73717384

73727385
def HLSLUnrollHintDocs : Documentation {
73737386
let Category = DocCatStmt;
7374-
let Heading = "[unroll(x)]";
7387+
let Heading = "[unroll(x)], [unroll]";
73757388
let Content = [{
73767389
Loop unrolling optimization hints can be specified with ``[unroll(x)]``
73777390
. The attribute is placed immediately before a for, while,
@@ -7385,9 +7398,43 @@ unroller to unroll the loop ``_value_`` times. Note: [unroll(x)] is not compatib
73857398
for (...) {
73867399
...
73877400
}
7388-
See
7389-
`hlsl loop extensions
7390-
<https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
7401+
7402+
.. code-block:: hlsl
7403+
7404+
[unroll]
7405+
for (...) {
7406+
...
7407+
}
7408+
7409+
.. code-block:: hlsl
7410+
7411+
[unroll(4)]
7412+
while (...) {
7413+
...
7414+
}
7415+
7416+
.. code-block:: hlsl
7417+
7418+
[unroll]
7419+
while (...) {
7420+
...
7421+
}
7422+
7423+
.. code-block:: hlsl
7424+
7425+
[unroll(4)]
7426+
do {
7427+
...
7428+
} while (...)
7429+
7430+
.. code-block:: hlsl
7431+
7432+
[unroll]
7433+
do {
7434+
...
7435+
} while (...)
7436+
7437+
See `hlsl loop extensions <https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
73917438
for details.
73927439
}];
73937440
}
@@ -7451,7 +7498,8 @@ b for constant buffer views (CBV).
74517498

74527499
Register space is specified in the format ``space[number]`` and defaults to ``space0`` if omitted.
74537500
Here're resource binding examples with and without space:
7454-
.. code-block:: c++
7501+
7502+
.. code-block:: hlsl
74557503

74567504
RWBuffer<float> Uav : register(u3, space1);
74577505
Buffer<float> Buf : register(t1);
@@ -7469,7 +7517,7 @@ A subcomponent is a register number, which is an integer. A component is in the
74697517

74707518
Examples:
74717519

7472-
.. code-block:: c++
7520+
.. code-block:: hlsl
74737521

74747522
cbuffer A {
74757523
float3 a : packoffset(c0.y);

0 commit comments

Comments
 (0)