Class MgfxWriter
- Namespace
- ShadowDusk.Core
- Assembly
- ShadowDusk.Core.dll
Serializes a fully assembled ShaderIR into the binary MGFX container
MonoGame/KNI's Effect loads (the "MGFX" header, constant buffers, shader blobs,
parameters, and techniques). Counts and sizes that the format stores in a single byte
or int16 are guarded so an oversized effect fails loudly (SD002x) rather than silently
truncating into a corrupt file. The emitted version is controlled via
MgfxWriterOptions (default v10, the most backwards-compatible choice).
public sealed class MgfxWriter
- Inheritance
-
MgfxWriter
- Inherited Members
Methods
Write(ShaderIR, MgfxWriterOptions)
Serializes ir into the binary MGFX container bytes.
public Result<byte[], ShaderError> Write(ShaderIR ir, MgfxWriterOptions options)
Parameters
irShaderIRThe fully assembled effect IR to serialize.
optionsMgfxWriterOptionsThe target profile and MGFX version to emit.
Returns
- Result<byte[], ShaderError>
The MGFX bytes on success, or a ShaderError (e.g.
SD002x) when a count or size exceeds what the format can store.