{"record":{"id":"e0c050f8f295b527","repo":"stride3d/stride","slug":"can-t-parse-method-attribute-anyattribute-on-method-name","errorCode":null,"errorMessage":"Can't parse method attribute {anyAttribute} on method {Name}","messagePattern":"Can't parse method attribute (.+?) on method (.+?)","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.MethodOrMember.cs","lineNumber":610,"sourceCode":"                    }\n                    else if (anyAttribute.Name == \"outputtopology\")\n                    {\n                        var value = ((StringLiteral)anyAttribute.Parameters[0]).Value;\n                        if (value != \"line\")\n                        {\n                            // VertexOrderCw/Ccw are only valid on TessellationEvaluation per\n                            // SPIR-V spec; route to DSMain (same reason as partitioning above).\n                            context.Add(new OpExecutionMode(GetTessEvaluationFunctionId(table, function.Id), ((StringLiteral)anyAttribute.Parameters[0]).Value switch\n                            {\n                                \"triangle_cw\" => Specification.ExecutionMode.VertexOrderCw,\n                                \"triangle_ccw\" => Specification.ExecutionMode.VertexOrderCcw,\n                                _ => throw new NotSupportedException($\"Unsupported output topology value '{((StringLiteral)anyAttribute.Parameters[0]).Value}'\"),\n                            }, []));\n                        }\n                    }\n                    else\n                    {\n                        throw new NotImplementedException($\"Can't parse method attribute {anyAttribute} on method {Name}\");\n                    }\n                }\n            }\n        }\n\n        if (Type is not FunctionType ftype)\n            throw new InvalidOperationException();\n\n        table.Push(SymbolFrame!);\n        builder.BeginFunction(context, function);\n\n        var functionInfo = new OpFunctionMetadataSDSL(Specification.FunctionFlagsMask.None, 0);\n\n        if (IsOverride)\n        {\n            // Find parent function\n            var parentSymbol = table.ResolveSymbol(function.Name);\n            // If multiple symbol with same name, find the proper overload (it should have the exact same signature)","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.MethodOrMember.cs#L592-L628","documentation":"ShaderMethod handles a known set of method attributes (domain, partitioning, outputtopology, etc.). When an attribute name reaches the final else with no handler, the compiler does not know what SPIR-V (if anything) to emit and throws NotImplementedException naming the attribute and method.","triggerScenarios":"Annotating a shader method with an attribute the SPIR-V backend does not handle, e.g. a legacy D3D attribute or a typo such as [partioning(...)].","commonSituations":"Porting legacy SDSL/D3D shader code whose attributes were accepted by the older DX backend but have no SPIR-V translation yet.","solutions":["Remove the unsupported attribute from the method.","Replace it with a supported equivalent attribute (see ShaderMethod's handled names in ShaderElements.MethodOrMember.cs).","Implement a handler for the attribute in the compiler if you own the code and SPIR-V supports the corresponding execution mode."],"exampleFix":"// before\n[legacyAttribute(4)]\nvoid GSMain(...) {}\n// after\nvoid GSMain(...) {} // drop or replace the unsupported attribute","handlingStrategy":"try-catch","validationCode":"var handledAttrs = new HashSet<string> { \"domain\", \"partitioning\", \"outputtopology\" };\nforeach (var a in method.Attributes)\n    if (!handledAttrs.Contains(a.Name)) Console.WriteLine($\"Attribute {a.Name} may not be supported\");","typeGuard":null,"tryCatchPattern":"try { method.Compile(); }\ncatch (NotImplementedException ex) when (ex.Message.Contains(\"Can't parse method attribute\"))\n{\n    // remove or replace the unsupported attribute, or add a compiler handler\n}","preventionTips":["Limit method attributes to those handled by the SPIR-V backend.","Normalize attribute names/typos when porting legacy D3D shaders.","Track compiler releases for newly supported attributes before upgrading."],"tags":["shader","sdsl","attributes","not-implemented"],"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"}