{"record":{"id":"cba5aecd577b2a31","repo":"stride3d/stride","slug":"attribute-attribute-is-not-supported","errorCode":null,"errorMessage":"Attribute {attribute} is not supported","messagePattern":"Attribute (.+?) is not supported","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.cs","lineNumber":308,"sourceCode":"                                        result.LinkId = linkLiteralSymbol.IdRef;\n                                    }\n                                    else\n                                    {\n                                        result.LinkName = linkLiteral.Value;\n                                    }\n                                }\n                                else if (anyAttribute.Parameters[0] is Identifier identifier)\n                                {\n                                    if (!table.TryResolveSymbol(identifier.Name, out var linkSymbol))\n                                    {\n                                        throw new InvalidOperationException();\n                                    }\n                                    linkSymbol = ShaderDefinition.ImportSymbol(table, context, linkSymbol);\n                                    result.LinkId = linkSymbol.IdRef;\n                                }\n                                else\n                                {\n                                    throw new NotImplementedException($\"Attribute {attribute} is not supported\");\n                                }\n                                break;\n                            }\n                        case \"Color\":\n                            result.Color = true;\n                            break;\n                    }\n                }\n            }\n        }\n\n        return result;\n    }\n\n    public override void ProcessSymbol(SymbolTable table, SpirvContext context)\n    {\n        base.ProcessSymbol(table, context);\n        foreach (var cbMember in Members)","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.cs#L290-L326","documentation":"ProcessAttributes analyzes cbuffer member attributes (currently Link and Color). Inside the Link case, the first attribute parameter must be either a StringLiteral or an Identifier; anything else (e.g. a numeric literal, expression, or missing/malformed parameter) falls into the else branch and throws NotImplementedException naming the attribute. It is a 'parameter shape not implemented' guard, not a general unsupported-attribute message.","triggerScenarios":"Declaring a cbuffer member with [Link] whose first parameter is neither a quoted string nor an identifier, e.g. [Link(42)] or [Link(some.expr)] in SDSL source.","commonSituations":"Hand-written or code-generated SDSL with an incorrectly typed Link argument; API changes where Link used to accept other literal kinds; copy-pasted attributes from other shader languages.","solutions":["Pass the Link parameter as a quoted string or a bare identifier, e.g. [Link(\"MyParams\")] or [Link(MyParams)].","Verify the referenced symbol resolves in the shader's inheritance/composition context (an Identifier that cannot resolve throws InvalidOperationException before this point).","If a new parameter kind is needed, extend the switch in ProcessAttributes (ShaderElements.cs:269) to handle that literal type."],"exampleFix":"// before\n[Link(0)]\nstruct MyCBuffer { ... };\n// after\n[Link(\"0\")]\nstruct MyCBuffer { ... };","handlingStrategy":"validation","validationCode":"foreach (var attr in attributes ?? new())\n    if (attr is AnyShaderAttribute a && a.Name == \"Link\"\n        && a.Parameters.Count > 0\n        && a.Parameters[0] is not (StringLiteral or Identifier))\n        throw new FormatException(\"[Link] parameter must be a string literal or identifier\");","typeGuard":"bool HasValidLinkParameter(ShaderAttribute attr) =>\n    attr is AnyShaderAttribute { Name: \"Link\", Parameters.Count: > 0 } a\n    && a.Parameters[0] is StringLiteral or Identifier;","tryCatchPattern":"try { result = CBuffer.ProcessAttributes(table, context, info, attributes); }\ncatch (NotImplementedException ex) { reportDiagnostic(info, ex.Message); }","preventionTips":["Always write [Link(\"Name\")] or [Link(Name)] — never numeric or expression parameters.","Validate SDSL attribute parameters with a lint pass before invoking the symbol processor.","Check referenced link symbols exist in the shader's composition chain."],"tags":["shader-parsing","sdsl","attributes"],"backgroundTag":"invalid-argument-format","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"}