DirectX12ShaderInfo
Description
- Derived from
| 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
DirectX12ShaderInfo
Creates a new instance of DirectXShaderInfo.
This is the grammar for parsing the leading comment block of Assembler Output / *.asm files:
asm := (buffer-definitions | structure-definition
| resource-bindings | line-break | skip)* ;
buffer-definitions := 'Buffer Definitions:' line-break (line-break*
buffer-definition)* ;
resource-bindings := 'Resource Bindings:' line-break+
resource-bindings-header? resource-binding* ;
skip := ~line-break+ line-break+ ;
structure-definition := 'Resource' ('bind' 'info' 'for')? identifier '{'
('struct' ]{[* '{' ]}[* '}' '$Element' ';')? '; Offset:'
'0' 'Size:' number '}' ;
buffer-definition := 'cbuffer' identifier '{' 'struct' (identifier .. '.')
'{' buffer-element* '}' identifier ';' '; Offset:' '0'
'Size:' number '}' ;
resource-binding := identifier ('[' number ']')? identifier identifier word
identifier ('s' | 't' | 'u' | 'cb') number number ' '*
line-break ;
resource-bindings-header := 'Name' 'Type' 'Format' 'Dim' 'ID' 'HLSL Bind' 'Count'
line-break '-'+[7] line-break ;
buffer-element := matrix-order? data-type identifier ('[' number ']')? ';'
'; Offset:' number line-break ;
word := (letter | '/' | digit)+ ;
data-type := data-type-name (data-type-count 'x' data-type-count
| data-type-count)? ;
identifier := letter (letter | digit)* ;
line-break := '\r'? '\n' ;
matrix-order := 'row_major' | 'column_major' ;
number := digit+ ;
data-type-count := '1' | '2' | '3' | '4' ;
data-type-name := 'float' | 'int' | 'uint' | 'bool' ;
digit := '0'..'9' ;
letter := 'a'..'z' | 'A'..'Z' | '_' ;
- ValidatingException
-
The assemblerOutput in is malformed and cannot be parsed.
Public / Methods
Reduce
Reduces the given assemblerOutput in by retaining required metadata only.
- ValidatingException
-
The assemblerOutput in is malformed and cannot be parsed.