DirectX11ShaderInfo

Description

sealed class Tinman.AddOns.DirectX11.Effects.DirectX11ShaderInfo

Full source code is included in the Tinman 3D SDK download.

Represents the shader metadata that the HLSL compiler writes into the Assembler Output / *.asm files.

The source code produced via ICodeOutput is minimal but parseable Assembler Output / *.asm file that contains the required shader metadata, see Reduce.

Public / Constructors

Direct​X11​Shader​Info


public constructor DirectX11ShaderInfo → (1)

assemblerOutput in : string

[not-null]
Source code of the Assembler Output / *.asm file, generated by the HLSL compiler.

Creates a new instance of DirectXShaderInfo.

This is the grammar for parsing the leading comment block of Assembler Output / *.asm files:

asm                      := (skip-line | skip-section | input-signature
                            | buffer-definitions | structure-definition
                            | resource-bindings | line-break)* ;

buffer-definitions       := 'Buffer Definitions:' line-break (line-break*
                            buffer-definition)* ;
input-signature          := 'Input signature:' ~line-break* line-break+
                            ignore-line* ;
resource-bindings        := 'Resource Bindings:' line-break+
                            resource-bindings-header? resource-binding* ;
skip-line                := ('Generated by' | 'Approximately') ~line-break*
                            line-break+ ;
skip-section             := ('Output signature:' | 'Patch Constant signature:'
                            | 'Tessellation Domain'
                            | 'Tessellation Output Primitive'
                            | 'Pixel Shader runs at sample frequency')
                            ~line-break* line-break+ ignore-line* ;
structure-definition     := 'Resource' ('bind' 'info' 'for')? identifier '{'
                            ('struct' identifier '{' ]}[* '}' '$Element' ';')?
                            '// Offset:' '0' 'Size:' number '}' ;

buffer-definition        := 'cbuffer' identifier '{' buffer-element* '}' ;
ignore-line              := ~line-break+ line-break ;
resource-binding         := identifier ('[' number ']')? identifier identifier word
                            ('s' | 't' | 'u' | 'cb') number number ' '* line-break ;
resource-bindings-header := 'Name' 'Type' 'Format' 'Dim' 'HLSL Bind' 'Count'
                            line-break '-'+[6] line-break ;

buffer-element           := matrix-order? identifier identifier ('[' number ']')?
                            ';' '// Offset:' number 'Size:' number '[unused]'?
                            line-break ;
word                     := (letter | '/' | digit)+ ;

identifier               := letter (letter | digit)* ;
line-break               := '\r'? '\n' ;
matrix-order             := 'row_major' | 'column_major' ;
number                   := digit+ ;

digit                    := '0'..'9' ;
letter                   := 'a'..'z' | 'A'..'Z' | '_' ;
ValidatingException

The assemblerOutput in is malformed and cannot be parsed.

Public / Methods

Reduce


[Pure]
public static method Reduce → (1)

assemblerOutput in : string

[not-null]
Source code of the Assembler Output / *.asm file, generated by the HLSL compiler.

returns → string

The reduced source code.

Reduces the given assemblerOutput in by retaining required metadata only.

ValidatingException

The assemblerOutput in is malformed and cannot be parsed.

Public / Attributes

Input​Signature​Key


public attribute InputSignatureKey → (get)

value : GUID

[not-null]
The input signature or GUID.Zero if there is none.

The input signature identifier.