Skip to main content

Module reflection

Module reflection 

Source
Expand description

The entry point’s metadata, resource records, type annotations and signature parts of an SM6 container, as the records the file stores: the entry point and what its properties state (thread group, geometry, mesh, hull and domain state), its signature elements and their packing, the bound resource ranges of dx.resources with their tags, the field annotations of dx.typeAnnotations, and the rows of an ISG1/OSG1/PSG1 part, each with DXIL’s and D3D’s own numbers, and the entry point’s other property tags, the tail tags of its signature elements, the optional fields of the resource records and the string attributes of the entry function. What the numbers mean for a graphics API is the caller’s to decide.

Structs§

Binding
A bound resource as dxc’s listing writes it in its Resource Bindings table (PrintResourceBindings): its range, its variable’s name and type, and its sample count, with the table’s names for them.
Element
One signature element of the entry point: its id (the sigId loadInput and storeOutput name), its first register and column, and its size.
ElementTags
The trailing tags of one signature element (the element record’s operand 10, a list of tag and value pairs). The compiler writes tag 0 for an output of another stream than 0, tag 2 for an input indexed dynamically and tag 3 for the components in use. Of the 691,000 elements of skate.’s and Elden Ring’s programs only tag 3 occurs.
EntryProperty
One property of the entry point as stored: the tag and the metadata record holding the value (an integer constant or a node), None where the value is null. The tags the compiler writes: 0 shader flags, 1 geometry state, 2 domain state, 3 hull state, 4 thread group, 5 auto binding space, 6 ray payload size, 7 ray attribute size, 8 shader kind (libraries), 9 mesh state, 10 amplification state, 11 wave size, 12 root signature, 23 wave size range.
FieldAnnotation
One field of a struct type, as its annotation in dx.typeAnnotations states it.
GeometryState
What a geometry program’s entry point states (the properties’ tag 1), as stored: the primitive it reads (input, a D3D_PRIMITIVE: 1 point, 2 line, 3 triangle, 6 line and 7 triangle with adjacency), how many vertices it emits at most, the streams it writes (a mask), the topology its stream makes (a D3D_PRIMITIVE_TOPOLOGY: 1 point list, 3 line strip, 5 triangle strip) and how many invocations run for a primitive.
HullState
What a hull program’s entry point states about its patch (the properties’ tag 3): the patch-constant function, the control-point counts, the tessellator’s domain, partitioning and output primitive and the largest factor.
MeshState
What a mesh program’s entry point states (the properties’ tag 9) after its thread group, as stored: the most vertices and primitives it writes, the topology of its primitives (1 line, 2 triangle) and the size in bytes of the payload it reads from a task program. A null field is zero.
Range
A bound resource range: class (0 SRV, 1 UAV, 2 constant buffer, 3 sampler), range id, first register, count.
ResourceExtras
The optional fields of a resource record that Range leaves out, keyed by the record’s class and id.
SignatureElement
One element of an ISG1/OSG1/PSG1 part as stored.
StructAnnotation
A struct type’s annotation in dx.typeAnnotations: its size in a constant buffer and its fields.

Functions§

amplification_payload_size
The payload size in bytes an amplification program’s entry point states (the second field of its state, tag 10); None for any other program. The first field is the thread group (num_threads).
auto_binding_space
The register space automatic bindings take, as the entry point states it (tag 5, a one-integer node); None where it states none. The stock libraries state 0 on the record that holds their resources (which has no function) and the compiler option -auto-binding-space changes that record’s value: library_binding_space reads it.
bindings
The bound resources of dx.resources in the order dxc’s listing writes them: constant buffers, samplers, SRVs, then UAVs, each class in the order of its list.
component_name
The name dxc gives a DXIL component type (CompType::GetName: 4 i32, 5 u32, 9 f32, …); invalid for 0 and unknown numbers.
dimension_name
The name dxc’s listing gives a resource kind’s dimension (DxilResourceBase::GetResDimName: 2 2d, 10 buf, 12 structbuf, …); invalid for 0 and unknown numbers.
domain_state
A domain program’s patch state (tag 2): the tessellator domain and the input control point count.
element_tags
The trailing tags of each signature element, in the order of elements’ inputs and outputs and patch_elements; an element with no tag list has ElementTags::default.
elements
The entry point’s input and output elements, by id.
entry
The entry point’s function value.
entry_properties
Every property of the entry point, in the order stored; none where the entry point states none.
fields
Fields of a struct type from dx.typeAnnotations (field tag 6 the name, 3 the constant-buffer offset, 7 the component type). Empty when the module has no annotation for it.
fp32_denorm_mode
The denormal mode an entry function states for 32-bit floats, as the string attribute fp32-denorm-mode has it (any, preserve or ftz). None where the function carries no such attribute, which is the case in all of the 69,728 programs of skate. and Elden Ring: the compiler writes the attribute only where the option asks for a mode.
geometry_state
A geometry program’s state.
hull_state
A hull program’s patch state.
library_binding_space
The auto binding space the library’s resource record (the entry record with no function) states (tag 5). None where the module has no such record or it states none.
library_kind
The shader kind a library’s entry point states (properties tag 8): the numbers of a program’s kind (7 ray generation to 12 callable, 13 mesh).
mesh_state
A mesh program’s state.
module_shader_flags
The shader flags of the module as dxc’s DxilModule reads them: those of the first entry of dx.entryPoints, which for a library is the entry without a function that states the library’s own properties.
num_threads
The entry point’s thread group size (numthreads): the value of the properties’ tag 4 (a mesh or amplification program’s, the first field of its state, tag 9 or 10). None when the entry point states none (every stage but compute, mesh and amplification).
patch_elements
A hull or domain program’s patch-constant elements, by id.
ranges
The bound resource ranges of dx.resources (SRVs, UAVs, constant buffers, samplers), each with its variable’s name and the type its variable points to (the resource’s handle type).
ray_attribute_size
The size in bytes of the hit attributes a ray tracing program’s entry point states (tag 7); None where it states none.
ray_payload_size
The size in bytes of the ray payload a ray tracing program’s entry point states (tag 6); None for a program that states none (a ray generation program, or any other stage).
resource_extras
The optional fields of every resource record, in the order of ranges. A constant buffer’s and a sampler’s record have a tag list as their last operand as well.
shader_flags
The entry point’s shader flags: the value of the properties’ tag 0, a 64-bit mask kept as stored. None when the entry point states none (the properties are null, or have no tag 0). The compiler writes the tag in nearly every entry point of the games read; this reader attaches no meaning to its bits.
shader_model
The shader model dx.shaderModel states: the kind as dxc’s targets name it (ps, vs, lib, ms, …) and the major and minor version.
signature
The elements of a signature part (ISG1, OSG1 or PSG1): a count and the offset of the first record, then records of 32 bytes (stream, name offset, semantic index, system value, component type, register, mask and read-write mask, minimum precision). A name ends within 256 bytes.
struct_annotation
The annotation dx.typeAnnotations states for a struct type (kind 0, then pairs of a struct-typed value and its annotation: the size, one node per field, and from DXIL 1.5 a node of template arguments after them), where it states one.
usage_masks
The usage mask of each signature element (tag 3 of the element’s trailing tag list: the components of the element the program reads or writes, bit 0 the element’s first component, so a scalar packed into component w states 1, not 8), in the order of elements’ inputs and outputs and patch_elements; None for an element whose trailing tag list is absent or has no tag 3. In the stock programs the only tag the lists hold is 3 (138,044 of 145,462 elements of skate.’s, 459,288 of 545,303 of Elden Ring’s); any other tag is ignored (see element_tags for them).
view_id_state
The serialised view-id state dx.viewIdState holds (an i32 array: the input scalar count, then per stream the output scalar count and its dependency tables), where the module has it.
wave_size
The wave size a compute, mesh or amplification program’s entry point requires (tag 11, a node): its integers as stored, a single one for a fixed size; None where the entry point states none.