You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/docs/DirectX/DXContainer.rst
+38-31Lines changed: 38 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -393,26 +393,18 @@ bit in the mask vector identifies one column of a patch constant input and a
393
393
column of an output. A value of 1 means the output is impacted by the primitive
394
394
input.
395
395
396
-
SFI0 Part
397
-
---------
398
-
.. _SFI0:
399
-
400
-
The SFI0 part encodes a 64-bit unsigned integer bitmask of the feature flags.
401
-
This denotes which optional features the shader requires. The flag values are
402
-
defined in `llvm/include/llvm/BinaryFormat/DXContainerConstants.def <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/BinaryFormat/DXContainerConstants.def>`_.
403
-
404
396
Root Signature (RTS0) Part
405
397
--------------------------
406
398
.. _RTS0:
407
399
408
-
The Root Signature data defines the shader's resource interface with Direct3D 12,
409
-
specifying what resources the shader needs to access and how they're organized
410
-
and bound to the pipeline.
400
+
The Root Signature data defines the shader's resource interface with Direct3D
401
+
12, specifying what resources the shader needs to access and how they're
402
+
organized and bound to the pipeline.
411
403
412
404
The RTS0 part comprises three data structures: ``RootSignatureHeader``,
413
405
``RootParameters`` and ``StaticSamplers``. The details of each will be described
414
-
in the following sections. All ``RootParameters`` will be serialized following the
415
-
order they were defined in the metadata representation.
406
+
in the following sections. All ``RootParameters`` will be serialized following
407
+
the order they were defined in the metadata representation.
416
408
417
409
Root Signature Header
418
410
~~~~~~~~~~~~~~~~~~~~~
@@ -450,14 +442,16 @@ the data is visible, and an offset calculated from the start of RTS0 section.
450
442
uint32_t ParameterOffset;
451
443
};
452
444
453
-
The following sections will describe each of the root parameters types and their encodings.
445
+
The following sections will describe each of the root parameters types and their
446
+
encodings.
454
447
455
448
Root Constants
456
449
''''''''''''''
457
450
458
451
Root constants are values passed directly to shaders without needing a constant
459
452
buffer. It is a 12 bytes long structure, two 32 bit values encoding the register
460
-
and space the constant is assigned to, and one 32 bit value encoding the constant value.
453
+
and space the constant is assigned to, and one 32 bit value encoding the
454
+
constant value.
461
455
462
456
.. code-block:: c
463
457
@@ -470,9 +464,13 @@ and space the constant is assigned to, and one 32 bit value encoding the constan
470
464
Root Descriptor
471
465
'''''''''''''''
472
466
473
-
Root descriptors provide direct GPU memory addresses to resources. Version 1.1 of
474
-
root descriptor is a 12 byte long, the first two 32 bit values encode the register
475
-
and space being assigned to the descriptor, and the last 32 bit value is an access flag flag.
467
+
Root descriptors provide direct GPU memory addresses to resources.
468
+
469
+
In version 1.0, the root descriptor is 8 bytes. It encodes the register and
470
+
space as 2 32-bit values.
471
+
472
+
In version 1.1, the root descriptor is 12 bytes. It matches the 1.0 descriptor
473
+
but adds a 32-bit access flag.
476
474
477
475
Version 1.0 doesn't contain the flags available in version 1.1.
478
476
@@ -491,18 +489,21 @@ Version 1.0 doesn't contain the flags available in version 1.1.
491
489
492
490
Root Descriptor Table
493
491
'''''''''''''''''''''
494
-
Descriptor tables let shaders access multiple resources through a single pointer to a descriptor heap.
492
+
Descriptor tables let shaders access multiple resources through a single pointer
493
+
to a descriptor heap.
495
494
496
-
The tables are made of a collection of descriptor ranges. Version 1.1 ranges are 24 bytes long, containing
497
-
five 32 bit values: The type of register, the number of registers in the range, the starting register number,
498
-
the register space, an offset in number of descriptors from the start of the table and finally an access flag.
495
+
The tables are made of a collection of descriptor ranges. In Version 1.0, the
496
+
descriptor range is 20 bytes, containing five 32 bit values. It encodes a range
497
+
of registers, including the register type, range length, register numbers and
498
+
space within range and the offset locating each range inside the table.
499
499
500
-
Version 1.0 ranges are the 20 bytes long, following the same structure without the flags.
500
+
In version 1.1, the descriptor range is 24 bytes. It matches the 1.0 descriptor
501
+
but adds a 32-bit access flag.
501
502
502
503
.. code-block:: c
503
504
504
505
struct DescriptorRange_V1_0 {
505
-
uint_32t RangeType;
506
+
uint32_t RangeType;
506
507
uint32_t NumDescriptors;
507
508
uint32_t BaseShaderRegister;
508
509
uint32_t RegisterSpace;
@@ -515,20 +516,18 @@ Version 1.0 ranges are the 20 bytes long, following the same structure without t
515
516
uint32_t BaseShaderRegister;
516
517
uint32_t RegisterSpace;
517
518
uint32_t OffsetInDescriptorsFromTableStart;
518
-
// Bitfield of flags from the Flags enum
519
519
uint32_t Flags;
520
520
};
521
521
522
522
Static Samplers
523
523
~~~~~~~~~~~~~~~
524
524
525
-
Static samplers are predefined filtering settings built into the root signature, avoiding descriptor heap lookups.
525
+
Static samplers are predefined filtering settings built into the root signature,
526
+
avoiding descriptor heap lookups.
526
527
527
-
This section also has a variable size. The size is 68 bytes long, containing the following fields: 32 bits for a
528
-
filter mode, three 32 bit fields for texture address mode, 64 bits for the bias value of minmap level calculation,
529
-
32 bits for maximum anisotropy level, 32 bits for the comparison function type, 32 bits for the static border colour,
530
-
two 64 bit fields for the min and max level of detail, two 32 bit fields for the register number and space and finally
531
-
32 bits for the shader visibility flag.
528
+
This section also has a variable size, since it can contain multiple static
529
+
samplers definitions. However, the definition is a fixed sized struct,
530
+
containing 13 32-byte fields of various enum, float, and integer values.
532
531
533
532
.. code-block:: c
534
533
@@ -548,3 +547,11 @@ two 64 bit fields for the min and max level of detail, two 32 bit fields for the
548
547
ShaderVisibility ShaderVisibility;
549
548
};
550
549
550
+
551
+
SFI0 Part
552
+
---------
553
+
.. _SFI0:
554
+
555
+
The SFI0 part encodes a 64-bit unsigned integer bitmask of the feature flags.
556
+
This denotes which optional features the shader requires. The flag values are
557
+
defined in `llvm/include/llvm/BinaryFormat/DXContainerConstants.def <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/BinaryFormat/DXContainerConstants.def>`_.
0 commit comments