Class MgfxSamplerStateResolver
- Namespace
- ShadowDusk.Core
- Assembly
- ShadowDusk.Core.dll
Resolves parsed sampler_state { … } members into the baked
MgfxSamplerStateInfo mgfxc writes into the .mgfx sampler
record (Phase 43, F9). Mirrors mgfxc v3.8.2's TPGParser/SamplerStateInfo
exactly:
- State is only present (
hasState = 1) when at least one recognized state member is set — a block containing onlyTexture = <…>resolves to null. - Defaults are MonoGame's
SamplerStateconstructor values: Wrap addressing, white border color, MaxAnisotropy 4, MaxMipLevel 0, LOD bias 0. - The separate Min/Mag/Mip filter members combine into ONE MonoGame
TextureFiltervia mgfxc'sUpdateSamplerStateif-chain ("None" treated like "Point");MipFilter = Noneadditionally forcesMipMapLevelOfDetailBias = -16(mgfxc's only mip-disable mechanism). - Unrecognized KEYS are ignored (the parser accepted them; fxc tolerates many D3D9 states MonoGame has no analog for), but a recognized key with an unparseable VALUE fails loudly (SD0024) — mgfxc's grammar would reject it, so silently dropping it would diverge from the mgfxc build.
public static class MgfxSamplerStateResolver
- Inheritance
-
MgfxSamplerStateResolver
- Inherited Members
Methods
Resolve(string, IEnumerable<(string Key, string Value)>, string)
Resolves a sampler's parsed state entries. Returns Ok(null) when no
recognized state member is present.
public static Result<MgfxSamplerStateInfo?, ShaderError> Resolve(string samplerName, IEnumerable<(string Key, string Value)> entries, string sourceFile)
Parameters
samplerNamestringThe sampler's name (diagnostics only).
entriesIEnumerable<(string Key, string Value)>The raw
(key, value)pairs from thesampler_stateblock, in source order.sourceFilestringThe source file (diagnostics only).