Table of Contents

Class CtabConstant

Namespace
ShadowDusk.Core.Reflection
Assembly
ShadowDusk.Core.dll

One constant from a D3D9 shader's CTAB constant table: the bridge between an HLSL global and the register(s) the SM1–3 bytecode reads it from. Class, Type carry the raw D3DXPARAMETER_CLASS/D3DXPARAMETER_TYPE values — numerically identical to MojoShader's symbol class/type and to the fx_2_0 typedef encoding (see docs/fx2-binary-format.md §6.1).

public sealed record CtabConstant : IEquatable<CtabConstant>
Inheritance
CtabConstant
Implements
Inherited Members

Constructors

CtabConstant(string, CtabRegisterSet, int, int, int, int, int, int, int, IReadOnlyList<float>?)

One constant from a D3D9 shader's CTAB constant table: the bridge between an HLSL global and the register(s) the SM1–3 bytecode reads it from. Class, Type carry the raw D3DXPARAMETER_CLASS/D3DXPARAMETER_TYPE values — numerically identical to MojoShader's symbol class/type and to the fx_2_0 typedef encoding (see docs/fx2-binary-format.md §6.1).

public CtabConstant(string Name, CtabRegisterSet RegisterSet, int RegisterIndex, int RegisterCount, int Class, int Type, int Rows, int Columns, int Elements, IReadOnlyList<float>? DefaultValue)

Parameters

Name string

The constant's name — in fx_2_0 effects this MUST match the effect parameter name exactly (MojoShader binds by strcmp).

RegisterSet CtabRegisterSet

Which register file the constant occupies.

RegisterIndex int

First register.

RegisterCount int

Number of registers occupied.

Class int

Raw D3DXPARAMETER_CLASS (0=scalar, 1=vector, 2=matrix-rows, 3=matrix-cols, 4=object, 5=struct).

Type int

Raw D3DXPARAMETER_TYPE (1=bool, 2=int, 3=float, 10–14=sampler…).

Rows int

Logical row count (CTAB stores rows-then-columns, the documented D3D order — unlike the fx_2_0 typedef quirk).

Columns int

Logical column count.

Elements int

Array element count (0 or 1 for non-arrays as written by the compiler; normalized to ≥ 1 here).

DefaultValue IReadOnlyList<float>

The constant's default value when the CTAB carries one and it is a scalar/vector (single register row); null otherwise. Matrix defaults are intentionally not read — their majority in CTAB is unverified (see docs/fx2-binary-format.md §15 F2) and a wrong-major default would silently corrupt rendering.

Properties

Class

Raw D3DXPARAMETER_CLASS (0=scalar, 1=vector, 2=matrix-rows, 3=matrix-cols, 4=object, 5=struct).

public int Class { get; init; }

Property Value

int

Columns

Logical column count.

public int Columns { get; init; }

Property Value

int

DefaultValue

The constant's default value when the CTAB carries one and it is a scalar/vector (single register row); null otherwise. Matrix defaults are intentionally not read — their majority in CTAB is unverified (see docs/fx2-binary-format.md §15 F2) and a wrong-major default would silently corrupt rendering.

public IReadOnlyList<float>? DefaultValue { get; init; }

Property Value

IReadOnlyList<float>

Elements

Array element count (0 or 1 for non-arrays as written by the compiler; normalized to ≥ 1 here).

public int Elements { get; init; }

Property Value

int

Name

The constant's name — in fx_2_0 effects this MUST match the effect parameter name exactly (MojoShader binds by strcmp).

public string Name { get; init; }

Property Value

string

RegisterCount

Number of registers occupied.

public int RegisterCount { get; init; }

Property Value

int

RegisterIndex

First register.

public int RegisterIndex { get; init; }

Property Value

int

RegisterSet

Which register file the constant occupies.

public CtabRegisterSet RegisterSet { get; init; }

Property Value

CtabRegisterSet

Rows

Logical row count (CTAB stores rows-then-columns, the documented D3D order — unlike the fx_2_0 typedef quirk).

public int Rows { get; init; }

Property Value

int

Type

Raw D3DXPARAMETER_TYPE (1=bool, 2=int, 3=float, 10–14=sampler…).

public int Type { get; init; }

Property Value

int