{"record":{"id":"b0a9c7dd6dd4b5fd","repo":"stride3d/stride","slug":"unsupported-partitioning-value-stringliteral-anyattribute","errorCode":null,"errorMessage":"Unsupported partitioning value '{((StringLiteral)anyAttribute.Parameters[0]).Value}'","messagePattern":"Unsupported partitioning value '(.+?)'","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.MethodOrMember.cs","lineNumber":590,"sourceCode":"                                \"tri\" => Specification.ExecutionMode.Triangles,\n                                \"quad\" => Specification.ExecutionMode.Quads,\n                                \"isolined\" => Specification.ExecutionMode.Isolines,\n                                _ => throw new NotSupportedException($\"Unsupported domain value '{((StringLiteral)anyAttribute.Parameters[0]).Value}'\"),\n                            }, []));\n                        }\n                    }\n                    else if (anyAttribute.Name == \"partitioning\")\n                    {\n                        // Spacing execution modes are only valid on TessellationEvaluation\n                        // per SPIR-V spec, but HLSL puts [partitioning] on the hull shader.\n                        // Emit the mode on DSMain's function id so the SPIR-V is spec-compliant.\n                        context.Add(new OpExecutionMode(GetTessEvaluationFunctionId(table, function.Id), ((StringLiteral)anyAttribute.Parameters[0]).Value switch\n                        {\n                            \"fractional_odd\" => Specification.ExecutionMode.SpacingFractionalOdd,\n                            \"fractional_even\" => Specification.ExecutionMode.SpacingFractionalEven,\n                            \"integer\" => Specification.ExecutionMode.SpacingEqual,\n                            \"pow2\" => throw new NotSupportedException(\"partitioning pow2 is not supported in SPIR-V\"),\n                            _ => throw new NotSupportedException($\"Unsupported partitioning value '{((StringLiteral)anyAttribute.Parameters[0]).Value}'\"),\n                        }, []));\n                    }\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","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/ShaderElements.MethodOrMember.cs#L572-L608","documentation":"The [partitioning(...)] attribute only recognizes 'fractional_odd', 'fractional_even', 'integer' (and 'pow2', which is explicitly rejected). Any other string has no SPIR-V spacing ExecutionMode and throws NotSupportedException from the switch's default arm.","triggerScenarios":"A tessellation stage annotated with a misspelled or unrecognized partitioning value, e.g. [partitioning(fractional)], [partitioning(equal)], or wrong casing.","commonSituations":"Porting FX/HLSL tessellation state blocks with different partitioning spellings, or typos when hand-writing the attribute.","solutions":["Use one of the exact values: fractional_odd, fractional_even, integer (pow2 throws separately).","Fix casing and spelling in the attribute string.","Check the SPIR-V spacing execution modes to confirm the intended value."],"exampleFix":"// before\n[partitioning(\"equal\")]\n// after\n[partitioning(\"integer\")]","handlingStrategy":"validation","validationCode":"var valid = new HashSet<string> { \"fractional_odd\", \"fractional_even\", \"integer\" };\nif (!valid.Contains(partitioningValue)) throw new ArgumentException($\"Unsupported partitioning '{partitioningValue}'\");","typeGuard":null,"tryCatchPattern":"try { method.Compile(); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Unsupported partitioning value\"))\n{\n    // fix the attribute string to a supported partitioning value\n}","preventionTips":["Use only fractional_odd, fractional_even, or integer as partitioning values.","Normalize spellings when converting from FX/HLSL tessellation state blocks."],"tags":["shader","sdsl","tessellation","attributes"],"backgroundTag":"invalid-enum-value","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"}