DirectX9ShaderInfo

Description

sealed class Tinman.AddOns.DirectX9.Effects.DirectX9ShaderInfo

Derived from

ICodeOutput

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​X9​Shader​Info


public constructor DirectX9ShaderInfo → (1)

assemblerOutput in : string

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

Creates a new instance of DirectX9ShaderInfo.

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

asm             := (skip-line | parameters | registers | line-break)* ;

parameters      := 'Parameters:' line-break+ parameter* line-break ;
registers       := 'Registers:' line-break+ register-header? register* line-break ;
skip-line       := ('Generated by' | 'approximately') ~line-break* line-break ;

parameter       := matrix-order? identifier identifier ('[' number ']')? ';' line-break ;
register        := identifier register-slot number line-break ;
register-header := 'Name' 'Reg' 'Size' line-break '-'+[3] line-break ;

identifier      := letter (letter | digit)* ;
line-break      := '\r'? '\n' ;
matrix-order    := 'row_major' | 'column_major' ;
register-slot   := [cs] number ;

letter          := 'a'..'z' | 'A'..'Z' | '_' ;
number          := digit+ ;

digit           := '0'..'9' ;
ValidatingException

The assemblerOutput in is malformed and cannot be parsed.

Public / Methods

Parameter


public method Parameter → (1)

name in : string

[not-null]
The parameter name.

returns → DirectX9ParameterInfo

The parameter info object or null if not found.

Returns the parameter info for the given name.

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

Parameters


public attribute Parameters → (get)

value : IVectorConst<DirectX9ParameterInfo>

[not-null]
List of parameter info objects.

The parameter infos.