{"record":{"id":"d6fa417f97090e34","repo":"stride3d/stride","slug":"unsupported-parameter-modifier-str","errorCode":null,"errorMessage":"Unsupported parameter modifier '{str}'","messagePattern":"Unsupported parameter modifier '(.+?)'","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.cs","lineNumber":151,"sourceCode":"            \"column_major\" => TypeModifier.ColumnMajor,\n            _ => TypeModifier.None\n        };\n    }\n\n    public static ParameterModifiers ToParameterModifiers(this string str)\n    {\n        return str switch\n        {\n            \"in\" => ParameterModifiers.In,\n            \"out\" => ParameterModifiers.Out,\n            \"inout\" => ParameterModifiers.InOut,\n            \"const\" => ParameterModifiers.Const,\n            \"point\" => ParameterModifiers.Point,\n            \"line\" => ParameterModifiers.Line,\n            \"lineadj\" => ParameterModifiers.LineAdjacency,\n            \"triangle\" => ParameterModifiers.Triangle,\n            \"triangleadj\" => ParameterModifiers.TriangleAdjacency,\n            _ => throw new NotSupportedException($\"Unsupported parameter modifier '{str}'\"),\n        };\n    }\n}\n\npublic partial class TypeDef(TypeName type, Identifier name, TextLocation info) : ShaderElement(info)\n{\n    public Identifier Name { get; set; } = name;\n    public TypeName TypeName { get; set; } = type;\n\n    public override string ToString()\n    {\n        return $\"typedef {TypeName} {Name}\";\n    }\n}\n\npublic abstract class ShaderBuffer : ShaderElement\n{\n    public string Name { get; set; }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.cs#L133-L169","documentation":"ToParameterModifiers is an extension method that maps SDSL parameter modifier keywords (in, out, inout, const, point, line, lineadj, triangle, triangleadj) to the ParameterModifiers enum. When the parser encounters a modifier token not in this switch table, it throws NotSupportedException naming the offending token. It indicates the shader source uses a parameter modifier the current parser does not recognize.","triggerScenarios":"Parsing a shader whose stage parameter declarations contain a modifier string outside the nine handled keywords, e.g. an unsupported HLSL/SPIR-V modifier or a typo such as 'inoutt'.","commonSituations":"Porting HLSL shaders using modifiers not yet supported by the SDSL front-end (e.g. 'linear', 'nointerpolation', 'centroid' applied to parameters), typos in shader source, or new language keywords added to the grammar before this mapping was extended.","solutions":["Check the exact modifier string in the message and correct the typo or remove the unsupported modifier from the shader source.","If the modifier is a legitimate keyword, extend the switch in ToParameterModifiers (sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.cs:138) with a new ParameterModifiers case.","Move semantics expressed by unsupported modifiers (e.g. interpolation modifiers) to attributes or TypeModifiers where the parser actually supports them."],"exampleFix":"// before (shader source)\nfloat4 main(linear float3 pos : POSITION) : SV_Position { ... }\n// after — remove or use a supported modifier\nfloat4 main(float3 pos : POSITION) : SV_Position { ... }","handlingStrategy":"validation","validationCode":"var supported = new[] { \"in\", \"out\", \"inout\", \"const\", \"point\", \"line\", \"lineadj\", \"triangle\", \"triangleadj\" };\nif (!supported.Contains(modifier)) throw new FormatException($\"Modifier '{modifier}' is not a supported SDSL parameter modifier\");","typeGuard":"bool IsValidParameterModifier(string? m) => m is \"in\" or \"out\" or \"inout\" or \"const\" or \"point\" or \"line\" or \"lineadj\" or \"triangle\" or \"triangleadj\";","tryCatchPattern":"try { mods = str.ToParameterModifiers(); }\ncatch (NotSupportedException ex) { log(ex.Message); /* skip token or report diagnostic */ }","preventionTips":["Validate modifier tokens against the supported list before invoking parser APIs.","Keep shaders free of HLSL-only interpolation modifiers on parameters.","When the SDSL grammar changes, update the modifier table alongside it."],"tags":["shader-parsing","sdsl","unsupported-keyword"],"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"}