@@ -7347,7 +7347,7 @@ where shaders must be compiled into a library and linked at runtime.
7347
7347
7348
7348
def HLSLLoopHintDocs : Documentation {
7349
7349
let Category = DocCatStmt;
7350
- let Heading = "# [loop]";
7350
+ let Heading = "[loop]";
7351
7351
let Content = [{
7352
7352
The ``[loop]`` directive allows loop optimization hints to be
7353
7353
specified for the subsequent loop. The directive allows unrolling to
@@ -7363,15 +7363,28 @@ unroller to not unroll the loop.
7363
7363
...
7364
7364
}
7365
7365
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>`_
7368
7381
for details.
7369
7382
}];
7370
7383
}
7371
7384
7372
7385
def HLSLUnrollHintDocs : Documentation {
7373
7386
let Category = DocCatStmt;
7374
- let Heading = "[unroll(x)]";
7387
+ let Heading = "[unroll(x)], [unroll] ";
7375
7388
let Content = [{
7376
7389
Loop unrolling optimization hints can be specified with ``[unroll(x)]``
7377
7390
. 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
7385
7398
for (...) {
7386
7399
...
7387
7400
}
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>`_
7391
7438
for details.
7392
7439
}];
7393
7440
}
@@ -7451,7 +7498,8 @@ b for constant buffer views (CBV).
7451
7498
7452
7499
Register space is specified in the format ``space[number]`` and defaults to ``space0`` if omitted.
7453
7500
Here're resource binding examples with and without space:
7454
- .. code-block:: c++
7501
+
7502
+ .. code-block:: hlsl
7455
7503
7456
7504
RWBuffer<float> Uav : register(u3, space1);
7457
7505
Buffer<float> Buf : register(t1);
@@ -7469,7 +7517,7 @@ A subcomponent is a register number, which is an integer. A component is in the
7469
7517
7470
7518
Examples:
7471
7519
7472
- .. code-block:: c++
7520
+ .. code-block:: hlsl
7473
7521
7474
7522
cbuffer A {
7475
7523
float3 a : packoffset(c0.y);
0 commit comments