Skip to content

Commit 787c920

Browse files
authored
Addressing comments
1 parent 0bcfa6b commit 787c920

File tree

1 file changed

+38
-31
lines changed

1 file changed

+38
-31
lines changed

llvm/docs/DirectX/DXContainer.rst

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -393,26 +393,18 @@ bit in the mask vector identifies one column of a patch constant input and a
393393
column of an output. A value of 1 means the output is impacted by the primitive
394394
input.
395395

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-
404396
Root Signature (RTS0) Part
405397
--------------------------
406398
.. _RTS0:
407399

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.
411403

412404
The RTS0 part comprises three data structures: ``RootSignatureHeader``,
413405
``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.
416408

417409
Root Signature Header
418410
~~~~~~~~~~~~~~~~~~~~~
@@ -450,14 +442,16 @@ the data is visible, and an offset calculated from the start of RTS0 section.
450442
uint32_t ParameterOffset;
451443
};
452444
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.
454447

455448
Root Constants
456449
''''''''''''''
457450

458451
Root constants are values passed directly to shaders without needing a constant
459452
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.
461455

462456
.. code-block:: c
463457
@@ -470,9 +464,13 @@ and space the constant is assigned to, and one 32 bit value encoding the constan
470464
Root Descriptor
471465
'''''''''''''''
472466

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.
476474

477475
Version 1.0 doesn't contain the flags available in version 1.1.
478476

@@ -491,18 +489,21 @@ Version 1.0 doesn't contain the flags available in version 1.1.
491489
492490
Root Descriptor Table
493491
'''''''''''''''''''''
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.
495494

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.
499499

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.
501502

502503
.. code-block:: c
503504
504505
struct DescriptorRange_V1_0 {
505-
uint_32t RangeType;
506+
uint32_t RangeType;
506507
uint32_t NumDescriptors;
507508
uint32_t BaseShaderRegister;
508509
uint32_t RegisterSpace;
@@ -515,20 +516,18 @@ Version 1.0 ranges are the 20 bytes long, following the same structure without t
515516
uint32_t BaseShaderRegister;
516517
uint32_t RegisterSpace;
517518
uint32_t OffsetInDescriptorsFromTableStart;
518-
// Bitfield of flags from the Flags enum
519519
uint32_t Flags;
520520
};
521521
522522
Static Samplers
523523
~~~~~~~~~~~~~~~
524524

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.
526527

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.
532531

533532
.. code-block:: c
534533
@@ -548,3 +547,11 @@ two 64 bit fields for the min and max level of detail, two 32 bit fields for the
548547
ShaderVisibility ShaderVisibility;
549548
};
550549
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

Comments
 (0)