stride3d/stride · error · NotImplementedException
An unknown EffectParameterClass was found.
Error message
An unknown EffectParameterClass was found.
What it means
While computing member sizes for shader reflection data, the compiler switches on EffectParameterClass (e.g. Vector, MatrixRows) to compute byte size. Encountering a parameter class not handled by the switch means the D3D reflection produced a class the compiler doesn't model, so it throws NotImplementedException.
Solutions
- Simplify the offending cbuffer member (use plain floats/vectors/matrices) in the HLSL source.
- Identify which member triggers it (the last memberType processed) and rewrite that shader construct.
- Update Stride to a version whose EffectParameterClass handling covers the class reported.
- If it is a new D3D reflection class from an SDK upgrade, pin the older d3dcompiler or extend the switch locally.
Example fix
// before
struct Params { MyInterface obj; float4 color; }; // interface member in cbuffer
// after
struct Params { float4 color; }; // only scalar/vector/matrix members Defensive patterns
Strategy: try-catch
Try / catch
try { var bc = ShaderCompiler.Compile(src, ep, stage, profile); }
catch (NotImplementedException ex) when (ex.Message.Contains("EffectParameterClass")) { /* simplify the offending cbuffer member or update Stride */ } Prevention
- Keep cbuffers to scalar/vector/matrix members
- Avoid interfaces and exotic constructs in constant buffers
- Keep Stride and the D3D compiler SDK versions aligned
When it happens
Trigger: Compiling/reflecting a shader whose constant buffer contains a member with an EffectParameterClass outside the handled set (scalar/vector/matrix classes) — e.g. unusual structured/interface/annotation parameter classes emitted by exotic HLSL constructs or a newer d3dcompiler reflecting new classes.
Common situations: Shaders using interfaces, structured buffers in cbuffers, or toolchain-produced effects with novel reflection classes; upgrading the Windows SDK/D3D compiler so reflection reports classes the old Stride switch never anticipated.
Related errors
- Shader Stage not supported.
- Graphics Profile not supported.
- An unknown EffectParameterType was found.
- The associated asset type does not have a public…
- The given instance is a value type and cannot have a item…
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/ff59cb6e33ca0809.
Report an issue: GitHub.
Appendix: source
Thrown at sources/shaders/Stride.Shaders.Compilers/Direct3D/ShaderCompiler.cs:578
}
case EffectParameterClass.Color:
case EffectParameterClass.Vector:
{
size = elementSize * memberType.ColumnCount;
break;
}
case EffectParameterClass.MatrixColumns:
{
size = elementSize * (4 * (memberType.ColumnCount - 1) + memberType.RowCount);
break;
}
case EffectParameterClass.MatrixRows:
{
size = elementSize * (4 * (memberType.RowCount - 1) + memberType.ColumnCount);
break;
}
default:
throw new NotImplementedException("An unknown EffectParameterClass was found.");
}
// Update element size
memberType.ElementSize = size;
// Array
if (memberType.Elements > 0)
{
var roundedSize = (size + 15) / 16 * 16; // Round up to 16 bytes (size of float4)
size += roundedSize * (memberType.Elements - 1);
alignment = 16;
}
// Align to float4 if it is bigger than leftover space in current float4
if (constantBufferOffset / 16 != (constantBufferOffset + size - 1) / 16)
alignment = 16;
// Align offset and store it as member offsetView on GitHub (pinned to 96fad776d2)