@@ -7344,7 +7344,7 @@ where shaders must be compiled into a library and linked at runtime.
7344
7344
7345
7345
def HLSLLoopHintDocs : Documentation {
7346
7346
let Category = DocCatStmt;
7347
- let Heading = "# [loop]";
7347
+ let Heading = "[loop]";
7348
7348
let Content = [{
7349
7349
The ``[loop]`` directive allows loop optimization hints to be
7350
7350
specified for the subsequent loop. The directive allows unrolling to
@@ -7360,15 +7360,28 @@ unroller to not unroll the loop.
7360
7360
...
7361
7361
}
7362
7362
7363
- See `hlsl loop extensions
7364
- <https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
7363
+ .. code-block:: hlsl
7364
+
7365
+ [loop]
7366
+ while (...) {
7367
+ ...
7368
+ }
7369
+
7370
+ .. code-block:: hlsl
7371
+
7372
+ [loop]
7373
+ do {
7374
+ ...
7375
+ } while (...)
7376
+
7377
+ See `hlsl loop extensions <https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
7365
7378
for details.
7366
7379
}];
7367
7380
}
7368
7381
7369
7382
def HLSLUnrollHintDocs : Documentation {
7370
7383
let Category = DocCatStmt;
7371
- let Heading = "[unroll(x)]";
7384
+ let Heading = "[unroll(x)], [unroll] ";
7372
7385
let Content = [{
7373
7386
Loop unrolling optimization hints can be specified with ``[unroll(x)]``
7374
7387
. The attribute is placed immediately before a for, while,
@@ -7382,9 +7395,43 @@ unroller to unroll the loop ``_value_`` times. Note: [unroll(x)] is not compatib
7382
7395
for (...) {
7383
7396
...
7384
7397
}
7385
- See
7386
- `hlsl loop extensions
7387
- <https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
7398
+
7399
+ .. code-block:: hlsl
7400
+
7401
+ [unroll]
7402
+ for (...) {
7403
+ ...
7404
+ }
7405
+
7406
+ .. code-block:: hlsl
7407
+
7408
+ [unroll(4)]
7409
+ while (...) {
7410
+ ...
7411
+ }
7412
+
7413
+ .. code-block:: hlsl
7414
+
7415
+ [unroll]
7416
+ while (...) {
7417
+ ...
7418
+ }
7419
+
7420
+ .. code-block:: hlsl
7421
+
7422
+ [unroll(4)]
7423
+ do {
7424
+ ...
7425
+ } while (...)
7426
+
7427
+ .. code-block:: hlsl
7428
+
7429
+ [unroll]
7430
+ do {
7431
+ ...
7432
+ } while (...)
7433
+
7434
+ See `hlsl loop extensions <https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for>`_
7388
7435
for details.
7389
7436
}];
7390
7437
}
@@ -7448,7 +7495,8 @@ b for constant buffer views (CBV).
7448
7495
7449
7496
Register space is specified in the format ``space[number]`` and defaults to ``space0`` if omitted.
7450
7497
Here're resource binding examples with and without space:
7451
- .. code-block:: c++
7498
+
7499
+ .. code-block:: hlsl
7452
7500
7453
7501
RWBuffer<float> Uav : register(u3, space1);
7454
7502
Buffer<float> Buf : register(t1);
@@ -7466,7 +7514,7 @@ A subcomponent is a register number, which is an integer. A component is in the
7466
7514
7467
7515
Examples:
7468
7516
7469
- .. code-block:: c++
7517
+ .. code-block:: hlsl
7470
7518
7471
7519
cbuffer A {
7472
7520
float3 a : packoffset(c0.y);
0 commit comments