Class MonoGameGlslRewriter
- Namespace
- ShadowDusk.GLSL
- Assembly
- ShadowDusk.GLSL.dll
Rewrites the modern GLSL that SPIRV-Cross emits (#version 140,
in/out, in_var_TEXCOORD0, texture(), a named UBO)
into the legacy MojoShader dialect that MonoGame's OpenGL runtime expects
(legacy varying names, gl_FragColor, texture2D(),
ps_uniforms_vec4[]). This is a pure string transform with no external
dependencies.
public static class MonoGameGlslRewriter
- Inheritance
-
MonoGameGlslRewriter
- Inherited Members
Methods
Rewrite(string, ShaderStage)
Rewrites SPIRV-Cross GLSL into the MonoGame/MojoShader dialect for the given stage.
public static MonoGameGlslResult Rewrite(string glsl, ShaderStage stage)
Parameters
glslstringThe modern GLSL emitted by SPIRV-Cross.
stageShaderStageThe shader stage being rewritten (vertex or pixel).
Returns
- MonoGameGlslResult
The rewritten GLSL together with the discovered samplers, uniform register count, and (for the vertex stage) vertex attributes.
Exceptions
- MonoGameGlslRewriteException
Thrown when the input GLSL cannot be rewritten faithfully into the dialect.