Table of Contents

Class GlslPortabilityAnalyzer

Namespace
ShadowDusk.GLSL
Assembly
ShadowDusk.GLSL.dll

Compile-time portability lint over the emitted MonoGame-GL GLSL. Flags constructs that compile fine here — and load on lenient desktop drivers — but are known to fail or silently misbehave at RUNTIME on narrower GL stacks (WebGL1 / KNI Reach, ANGLE Direct3D11 in Windows browsers, strict Mesa), where the consumer's only signal is MonoGame's lazy draw-time "Shader Compilation Failed" / "Unable to link effect program" exception with the real driver log hidden behind Debug.WriteLine — i.e. "an error on the SpriteBatch call".

Every finding is a Warning, never an error: the artifact is valid and renders on the stacks that accept it — the lint exists so the narrower stacks stop being a silent field failure. Findings surface through CompiledShader.Warnings. Codes SD0400SD0499 (registered in docs/error-codes.md).

public static class GlslPortabilityAnalyzer
Inheritance
GlslPortabilityAnalyzer
Inherited Members

Methods

Analyze(string, ShaderStage, bool, string, string?)

Analyzes one rewritten shader stage and returns the portability findings, all warning-severity. passHasVertexShader is the pass-level fact that decides whether the SpriteBatch interpolant check applies (a pass with its own VS defines its own varying contract and is exempt).

public static IReadOnlyList<ShaderError> Analyze(string glsl, ShaderStage stage, bool passHasVertexShader, string sourceFileName, string? entryPoint)

Parameters

glsl string

The final rewritten GLSL for the stage (the bytes that go into the effect).

stage ShaderStage

Which stage glsl is.

passHasVertexShader bool

Whether the pass this shader belongs to also has a vertex shader.

sourceFileName string

The consumer-facing source file name used on the findings.

entryPoint string

The HLSL entry-point name, for the finding text.

Returns

IReadOnlyList<ShaderError>