Class CompiledShaderBlob
- Namespace
- ShadowDusk.Core
- Assembly
- ShadowDusk.Core.dll
One compiled shader within an effect: its platform bytecode (Bytes) and
the stage it belongs to (Stage), plus the per-shader tables the effect
writers serialize (samplers, constant-buffer indices, vertex attributes, shader model).
public sealed record CompiledShaderBlob : IEquatable<CompiledShaderBlob>
- Inheritance
-
CompiledShaderBlob
- Implements
- Inherited Members
Constructors
CompiledShaderBlob(byte[], ShaderStage)
One compiled shader within an effect: its platform bytecode (Bytes) and
the stage it belongs to (Stage), plus the per-shader tables the effect
writers serialize (samplers, constant-buffer indices, vertex attributes, shader model).
public CompiledShaderBlob(byte[] Bytes, ShaderStage Stage)
Parameters
Bytesbyte[]The compiled platform bytecode (DXBC, SPIR-V-derived GLSL, or D3D9 token stream).
StageShaderStageThe pipeline stage this blob targets (vertex or pixel).
Properties
Attributes
Vertex-attribute table. Populated for GL vertex shaders only; empty for DirectX (which binds vertex inputs via the DXBC input signature). The count byte is still written on both profiles — see MgfxWriter.
public IReadOnlyList<MgfxVertexAttributeInfo> Attributes { get; init; }
Property Value
Bytes
The compiled platform bytecode (DXBC, SPIR-V-derived GLSL, or D3D9 token stream).
public byte[] Bytes { get; init; }
Property Value
- byte[]
ConstantBufferIndices
Indices (into the effect's global constant-buffer list) this shader uses.
public IReadOnlyList<int> ConstantBufferIndices { get; init; }
Property Value
Entrypoint
The HLSL entry-point function name, written per shader by MGFX v11+
(diagnostic-only). MGFX v10 and KNIFX omit it. Defaults to "<unknown>";
the pipeline populates it from the pass's vertex/pixel entry point.
public string Entrypoint { get; init; }
Property Value
Samplers
Sampler table for this shader (empty if it samples nothing).
public IReadOnlyList<MgfxSamplerInfo> Samplers { get; init; }
Property Value
ShaderModel
The HLSL shader model this blob was compiled from (Major, Minor), e.g. (3, 0)
for vs_3_0. MGFX v10 does not store this (MgfxWriter
ignores it); the KnifxWriter (KNIFX v11) serializes it per shader.
Defaults to (3, 0) — the MojoShader GL ceiling and the common case; the
compilation pipeline overrides it from the pass's profile string.
public (int Major, int Minor) ShaderModel { get; init; }
Property Value
SourceFile
The source .fx file path, written per shader by MGFX v11+
(diagnostic-only, used only in shader error messages). MGFX v10 and KNIFX omit it.
Defaults to "<unknown>", mgfxc's own null-fallback (render-faithful);
the pipeline populates it from the source file name.
public string SourceFile { get; init; }
Property Value
Stage
The pipeline stage this blob targets (vertex or pixel).
public ShaderStage Stage { get; init; }