stride3d/stride · error · NotImplementedException

An unknown EffectParameterType was found.

Error message

An unknown EffectParameterType was found.

What it means

During D3D shader bytecode compilation, Stride maps each reflection parameter's EffectParameterType to its byte size via a switch expression. If the reflection data contains an EffectParameterType not covered by the mapping (Float, Int, Bool, UInt, Double, Void), the default arm throws NotImplementedException. This indicates reflection metadata the compiler was never taught to translate.

Solutions

  1. Inspect the failing shader's reflection output and replace or retype the offending parameter with a supported type (float, int, bool, uint, double).
  2. Recompile shaders with the SPIRV/DXC version bundled with your Stride release instead of a custom/newer toolchain.
  3. Clear cached compiled effects (Effects/ cache, --graphvizoff / delete effect log and cache) and rebuild so reflection is regenerated with matching tooling.
  4. If a genuinely new EffectParameterType is needed, extend the switch in ShaderCompiler.cs:618 to map it to its byte size and file a Stride issue.
  5. Pin/align Stride and shader compiler versions so the reflection layer cannot surface unknown types.

Example fix

// before (shader / reflection exposes unmapped type)
uint64_t bigCounter; // EffectParameterType.UInt64 -> NotImplementedException

// after
uint bigCounter; // EffectParameterType.UInt -> mapped to 4 bytes
Defensive patterns

Strategy: validation

Validate before calling

// before compiling, scan reflection for supported parameter types
var supported = new HashSet<EffectParameterType> { EffectParameterType.Float, EffectParameterType.Int, EffectParameterType.Bool, EffectParameterType.UInt, EffectParameterType.Double, EffectParameterType.Void };
foreach (var p in shaderReflection.Parameters)
    if (!supported.Contains(p.ParameterType))
        throw new InvalidOperationException($"Shader '{shader.Name}' uses unsupported parameter type {p.ParameterType} on '{p.Name}'. Retype it (e.g. uint64 -> uint).");

Type guard

static bool HasSupportedParameterTypes(ShaderReflection reflection) =>
    reflection.Parameters.All(p =>
        p.ParameterType is EffectParameterType.Float or EffectParameterType.Int
            or EffectParameterType.Bool or EffectParameterType.UInt
            or EffectParameterType.Double or EffectParameterType.Void);

Try / catch

try
{
    var result = shaderCompiler.Compile(source, parameters);
}
catch (NotImplementedException ex) when (ex.Message.Contains("EffectParameterType"))
{
    log.Error($"Reflection contains a parameter type Stride cannot map: {ex.Message}. Fix the shader source or align compiler toolchain versions.");
    throw;
}

Prevention

When it happens

Trigger: ShaderCompiler.Compile encounters a constant/parameter whose EffectParameterType (from SPIRV-cross or DX reflection) falls through to the switch's default arm — i.e. a parameter type outside the known set {Float, Int, Bool, UInt, Double, Void}, typically produced by a newer shader toolchain emitting a newly introduced type (e.g. Int64/UInt64, or an unusual structured type).

Common situations: Using a newer DXC/SPIRV-Cross version that emits parameter types Stride's compiler doesn't know; exotic shader library code declaring 64-bit integer uniforms; compiling shaders on a platform/toolchain combination where reflection produces unmapped types; upgrading Stride while keeping old cached shader bytecode or vice versa.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/911e3de6a7de75c8. Report an issue: GitHub.

Appendix: source

Thrown at sources/shaders/Stride.Shaders.Compilers/Direct3D/ShaderCompiler.cs:618

                }

                //
                // Computes the size of a type based on its EffectParameterType.
                //
                static int ComputeTypeSize(EffectParameterType type)
                {
                    return type switch
                    {
                        EffectParameterType.Bool or
                        EffectParameterType.Float or
                        EffectParameterType.Int or
                        EffectParameterType.UInt => 4,

                        EffectParameterType.Double => 8,

                        EffectParameterType.Void => 0,

                        _ => throw new NotImplementedException("An unknown EffectParameterType was found.")
                    };
                }

                //
                // Creates a resource binding description from a Shader input binding description.
                //
                EffectResourceBindingDescription GetResourceBinding(ref readonly ShaderInputBindDesc bindingDescriptionRaw, string name)
                {
                    var paramClass = EffectParameterClass.Object;
                    var paramType = EffectParameterType.Void;

                    switch (bindingDescriptionRaw.Type)
                    {
                        case D3DShaderInputType.D3DSitTbuffer:
                            paramType = EffectParameterType.TextureBuffer;
                            paramClass = EffectParameterClass.TextureBuffer;
                            break;

View on GitHub (pinned to 96fad776d2)