Skip to main content

Module reflection

Module reflection 

Source
Expand description

The reflection (RDEF) and signature (ISGN, OSGN, ISG1, OSG1, OSG5, PCSG, PSG1) parts of a Shader Model 4 or 5 container, as the records they store: resource bindings, constant buffers with their variables and type trees, and signature elements, each with D3D’s own numbers (D3D_SHADER_INPUT_TYPE, D3D_NAME, …) and the word it starts at. What the numbers mean for a graphics API is the caller’s to decide.

Every table is bounded before it is read, every string is checked to end inside its part and be UTF-8, and a type tree is refused where it nests deeper than 32 or refers to itself.

Structs§

Rdef
A container’s RDEF part as stored: what it says the program binds and the layouts of its buffers.
RdefBinding
One resource binding record as stored.
RdefBuffer
One buffer (D3D11_SHADER_BUFFER_DESC) as stored, with its variables.
RdefMember
A struct member: its name, its byte offset in the struct and its type.
RdefType
A variable’s type record (D3D11_SHADER_TYPE_DESC) as stored, and its members’ types.
RdefVariable
One variable of a buffer as stored: its byte range in the buffer, its type and its default value.
SignatureElement
One element of a signature as stored.

Functions§

patch_signature_elements
A hull or domain program’s patch-constant signature elements as stored (the PCSG part, or the PSG1 part where the program uses minimum precision).
program_type
The type of a container’s program: its code part’s version token names it in the high 16 bits.
rdef
A container’s RDEF part (None where it has none): the Shader Model 4 layout where its target is a 4.x one (a 28-byte header, then the tables), the Shader Model 5.0 or 5.1 layout (the record-size directory its tag names) where it is a 5.x one.
rdef_target
The version token of a container’s first RDEF part (None where it has none), read without the rest of the part: a caller can tell which program model’s layout it holds before it asks rdef for the records.
signature
A signature part’s records. Layouts: ISGN/OSGN/PCSG (name, index, system value, component type, register, masks), ISG1/OSG1/PSG1 (a stream and a minimum precision besides) and OSG5 (a stream besides). kind is the part’s tag, which says which layout bytes has.
signature_elements
A container’s program type and its input and output signature elements as stored.