{"record":{"id":"911e3de6a7de75c8","repo":"stride3d/stride","slug":"an-unknown-effectparametertype-was-found","errorCode":null,"errorMessage":"An unknown EffectParameterType was found.","messagePattern":"An unknown EffectParameterType was found\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Compilers/Direct3D/ShaderCompiler.cs","lineNumber":618,"sourceCode":"                }\n\n                //\n                // Computes the size of a type based on its EffectParameterType.\n                //\n                static int ComputeTypeSize(EffectParameterType type)\n                {\n                    return type switch\n                    {\n                        EffectParameterType.Bool or\n                        EffectParameterType.Float or\n                        EffectParameterType.Int or\n                        EffectParameterType.UInt => 4,\n\n                        EffectParameterType.Double => 8,\n\n                        EffectParameterType.Void => 0,\n\n                        _ => throw new NotImplementedException(\"An unknown EffectParameterType was found.\")\n                    };\n                }\n\n                //\n                // Creates a resource binding description from a Shader input binding description.\n                //\n                EffectResourceBindingDescription GetResourceBinding(ref readonly ShaderInputBindDesc bindingDescriptionRaw, string name)\n                {\n                    var paramClass = EffectParameterClass.Object;\n                    var paramType = EffectParameterType.Void;\n\n                    switch (bindingDescriptionRaw.Type)\n                    {\n                        case D3DShaderInputType.D3DSitTbuffer:\n                            paramType = EffectParameterType.TextureBuffer;\n                            paramClass = EffectParameterClass.TextureBuffer;\n                            break;\n","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Compilers/Direct3D/ShaderCompiler.cs#L600-L636","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect the failing shader's reflection output and replace or retype the offending parameter with a supported type (float, int, bool, uint, double).","Recompile shaders with the SPIRV/DXC version bundled with your Stride release instead of a custom/newer toolchain.","Clear cached compiled effects (Effects/ cache, --graphvizoff / delete effect log and cache) and rebuild so reflection is regenerated with matching tooling.","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.","Pin/align Stride and shader compiler versions so the reflection layer cannot surface unknown types."],"exampleFix":"// before (shader / reflection exposes unmapped type)\nuint64_t bigCounter; // EffectParameterType.UInt64 -> NotImplementedException\n\n// after\nuint bigCounter; // EffectParameterType.UInt -> mapped to 4 bytes","handlingStrategy":"validation","validationCode":"// before compiling, scan reflection for supported parameter types\nvar supported = new HashSet<EffectParameterType> { EffectParameterType.Float, EffectParameterType.Int, EffectParameterType.Bool, EffectParameterType.UInt, EffectParameterType.Double, EffectParameterType.Void };\nforeach (var p in shaderReflection.Parameters)\n    if (!supported.Contains(p.ParameterType))\n        throw new InvalidOperationException($\"Shader '{shader.Name}' uses unsupported parameter type {p.ParameterType} on '{p.Name}'. Retype it (e.g. uint64 -> uint).\");","typeGuard":"static bool HasSupportedParameterTypes(ShaderReflection reflection) =>\n    reflection.Parameters.All(p =>\n        p.ParameterType is EffectParameterType.Float or EffectParameterType.Int\n            or EffectParameterType.Bool or EffectParameterType.UInt\n            or EffectParameterType.Double or EffectParameterType.Void);","tryCatchPattern":"try\n{\n    var result = shaderCompiler.Compile(source, parameters);\n}\ncatch (NotImplementedException ex) when (ex.Message.Contains(\"EffectParameterType\"))\n{\n    log.Error($\"Reflection contains a parameter type Stride cannot map: {ex.Message}. Fix the shader source or align compiler toolchain versions.\");\n    throw;\n}","preventionTips":["Stick to scalar types Stride maps (float, int, bool, uint, double) in shader parameters/uniforms.","Use the SPIRV-Cross/DXC versions bundled with your Stride release.","Clear the effect/shader cache after upgrading Stride or any shader toolchain.","Add a CI shader-compile step so unmapped reflection types fail at build time, not runtime.","Watch Stride release notes for newly supported EffectParameterType values before using newer types."],"tags":["shaders","compilation","reflection","not-implemented","direct3d"],"backgroundTag":"method-not-implemented","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}