Table of Contents

Namespace ShadowDusk.Compiler.Raylib

Classes

RaylibConvertOptions

Options for Convert(string, RaylibConvertOptions, CancellationToken).

RaylibConverter

Converts an HLSL .fx pixel shader to a raylib fragment shader for Raylib-cs (Phase 59, the fragment-only slice). The route is the same seam the SkSL converter uses: HLSL → [DXC] → SPIR-V → [SPIRV-Cross] → modern GLSL → [raylib convention mapper], branching before the MonoGame GLSL rewriter and the MGFX writer, so no substitute compiler is involved and no existing target's output changes.

Evidence model: rendered-image fidelity (owner decision 2026-10-01, the SkSL target's model): raylib has no reference compiler, so this is never an mgfxc-equivalence claim. The proof is validation/RaylibRoute, which renders each converted shader in real Raylib-cs and pixel-diffs it against the same .fx built for OpenGL and rendered in real MonoGame DesktopGL.

Input languages: anything that becomes .fx text. A .slang file goes through ConvertSlang(string, RaylibConvertOptions, CancellationToken) (built-in frontend) or ShadowDusk.Slang's SlangCompiler.ConvertToRaylib (real slangc); the HLSL either yields is compiled by the same DXC as every .fx, so the converter itself needs nothing Slang-specific.

Everything raylib's fixed-function model cannot hold is rejected loudly (SD0630–SD0636), never emitted as a shader that loads and renders wrong.

RaylibSampler

One sampler2D of a RaylibShader.

RaylibShader

The successful product: a raylib fragment shader plus the binding contract the consumer's draw code needs. Deliberately NOT a CompiledShader: that type's Data is an effect container every existing consumer hands to new Effect(...), and a GLSL string in that slot would load as garbage instead of failing.

RaylibUniform

One non-sampler uniform of a RaylibShader.