Table of Contents

Class CtabReader

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

Reads the CTAB constant-table comment out of a legacy D3D9 SM1–3 token stream — the reflection source for the FNA fx_2_0 path. Layout per docs/fx2-binary-format.md §11 (derived from MojoShader's parse_constant_table, which is what FNA itself runs on these bytes at load time, and the documented D3DXSHADER_CONSTANTTABLE structs).

Only the leading comment block(s) directly after the version token are scanned: that is where fxc and vkd3d both place the CTAB, and scanning the instruction stream would risk misreading raw IEEE-float immediates (e.g. from def) as comment tokens.

public static class CtabReader
Inheritance
CtabReader
Inherited Members

Methods

Read(ReadOnlySpan<byte>, string)

Parses the CTAB from d3d9Bytecode. Fails (never throws) when the blob is not a D3D9 token stream or carries no readable CTAB — a shader without a CTAB would bind zero parameters under MojoShader, so the FNA pipeline treats that as an error rather than producing a silently-dead effect.

public static Result<CtabTable, ShaderError> Read(ReadOnlySpan<byte> d3d9Bytecode, string sourceFile)

Parameters

d3d9Bytecode ReadOnlySpan<byte>
sourceFile string

Returns

Result<CtabTable, ShaderError>