{"record":{"id":"edc8494fdc0019c9","repo":"stride3d/stride","slug":"unsupported-qualifier-value-intrinsicdefinition-parameters-i","errorCode":null,"errorMessage":"Unsupported qualifier value: {intrinsicDefinition.Parameters[i].Qualifier}","messagePattern":"Unsupported qualifier value: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/IntrinsicTemplateExpander.cs","lineNumber":384,"sourceCode":"                        // Note: we remove auto matrix loop if result type is not either void or matrix of the desired size\n                        if (autoMatrixLoop != null)\n                        {\n                            if (parameterTypes[0] != ScalarType.Void && (parameterTypes[0] is not MatrixType || parameterTypeHelper[0].Size1.Generator != autoMatrixLoop))\n                                autoMatrixLoop = null;\n                        }\n\n                        var functionParameters = new List<FunctionParameter>();\n                        for (int i = 0; i < intrinsicDefinition.Parameters.Length; ++i)\n                        {\n                            var paramType = (SymbolType)parameterTypes[i + 1];\n                            var modifier = intrinsicDefinition.Parameters[i].Qualifier switch\n                            {\n                                Qualifier.In => ParameterModifiers.In,\n                                Qualifier.Out => ParameterModifiers.Out,\n                                Qualifier.InOut => ParameterModifiers.InOut,\n                                Qualifier.Ref => ParameterModifiers.Ref,\n                                null => ParameterModifiers.None,\n                                _ => throw new NotSupportedException($\"Unsupported qualifier value: {intrinsicDefinition.Parameters[i].Qualifier}\"),\n                            };\n\n                            // Wrap out/inout/ref parameters in PointerType, matching user-defined function convention\n                            if ((modifier & ParameterModifiers.Out) != 0 || modifier == ParameterModifiers.Ref)\n                                paramType = new PointerType(paramType, Specification.StorageClass.Function);\n\n                            functionParameters.Add(new(paramType, modifier));\n                        }\n                        var functionType = new FunctionType(parameterTypes[0], functionParameters);\n\n                        result.Add(new(functionType, autoMatrixLoop?.Locations, autoMatrixLoopSize));\n                    }\n                }\n            }\n\n            intrinsicDefinitionsCache.Add(name, result);\n            return true;\n        }","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/IntrinsicTemplateExpander.cs#L366-L402","documentation":"The expander maps SDSL Qualifier values (in/out/inout/ref) to SPIR-V-facing ParameterModifiers. A qualifier outside this set has no mapping, so the expansion of the intrinsic's parameter list fails with this NotSupportedException.","triggerScenarios":"An intrinsic parameter declares a Qualifier value other than In, Out, InOut, Ref, or null in the .sdsl intrinsic definition.","commonSituations":"Custom qualifiers added by newer Stride versions or user extensions that the intrinsic expander does not recognize; copy-pasted qualifiers from other shading languages (e.g. 'uniform', 'const') into intrinsic parameter lists.","solutions":["Change the parameter qualifier to one of in/out/inout/ref (or omit it)","Remove unsupported qualifiers like const/uniform from intrinsic parameter declarations","If a new qualifier is legitimate, extend the mapping switch in IntrinsicTemplateExpander"],"exampleFix":"// before\nvoid myIntrin(const float x);\n// after\nvoid myIntrin(in float x);","handlingStrategy":"validation","validationCode":"static readonly HashSet<Qualifier?> Allowed = new() { Qualifier.In, Qualifier.Out, Qualifier.InOut, Qualifier.Ref, null };\nif (intrinsicDefinition.Parameters.Any(p => !Allowed.Contains(p.Qualifier)))\n    throw new NotSupportedException(\"Intrinsic parameter uses unsupported qualifier\");","typeGuard":"bool IsSupportedQualifier(Qualifier? q) => q is null or Qualifier.In or Qualifier.Out or Qualifier.InOut or Qualifier.Ref;","tryCatchPattern":"try { Expand(intrinsic, args); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Unsupported qualifier value\")) { /* flag the .sdsl declaration */ }","preventionTips":["Use only in/out/inout/ref (or none) in intrinsic parameter lists","Lint .sdsl files for qualifiers not in the supported set","Update the expander mapping when introducing new qualifiers"],"tags":["sdsl","shaders","qualifiers","enum"],"backgroundTag":"unsupported-enum-value","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}