{"record":{"id":"40241ffe18e40c5c","repo":"stride3d/stride","slug":"unsupported-geometry-stream-output-kind-outputstreamtype","errorCode":null,"errorMessage":"Unsupported geometry stream output kind: {outputStreamType.Kind}","messagePattern":"Unsupported geometry stream output kind: (.+?)","errorType":"validation","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Spirv/Processing/Interfaces/Generation/EntryPointWrapperGenerator.cs","lineNumber":378,"sourceCode":"                entryPointFunctionType.ParameterTypes[0] = entryPointFunctionType.ParameterTypes[0] with { Modifiers = ParameterModifiers.None };\n                entryPointFunctionType.ParameterTypes.RemoveAt(1);\n\n                context.ReplaceType(entryPointFunctionType, entryPointTypeId);\n                context.Add(new OpExecutionMode(entryPoint.IdRef, executionMode switch\n                {\n                    ParameterModifiers.Point => ExecutionMode.InputPoints,\n                    ParameterModifiers.Line => ExecutionMode.InputLines,\n                    ParameterModifiers.LineAdjacency => ExecutionMode.InputLinesAdjacency,\n                    ParameterModifiers.Triangle => ExecutionMode.Triangles,\n                    ParameterModifiers.TriangleAdjacency => ExecutionMode.InputTrianglesAdjacency,\n                    _ => throw new NotSupportedException($\"Unsupported geometry input execution mode: {executionMode}\"),\n                }, []));\n                context.Add(new OpExecutionMode(entryPoint.IdRef, outputStreamType.Kind switch\n                {\n                    GeometryStreamOutputKindSDSL.Point => ExecutionMode.OutputPoints,\n                    GeometryStreamOutputKindSDSL.Line => ExecutionMode.OutputLineStrip,\n                    GeometryStreamOutputKindSDSL.Triangle => ExecutionMode.OutputTriangleStrip,\n                    _ => throw new NotSupportedException($\"Unsupported geometry stream output kind: {outputStreamType.Kind}\"),\n                }, []));\n\n                arguments[0] = inputsVariable;\n\n                // Call main(inputs) without 2nd argument\n                buffer.Add(new OpFunctionCall(voidType, context.Bound++, entryPoint.IdRef, [arguments[0], .. arguments[2..]]));\n            }\n        }\n        else\n        {\n            // We assume a void returning function and Input/Output is all handled with streams\n            // Note: we could in the future support having Input/Output in the function signature, just like we do for HS/DS/GS\n\n            // Copy variables from input to streams struct\n            foreach (var stream in streamLayout.InputStreams)\n            {\n                var streamPointer = buffer.Add(new OpAccessChain(context.GetOrRegister(new PointerType(stream.Info.Type, Specification.StorageClass.Private)), context.Bound++, streamLayout.StreamsVariableId, [context.CompileConstant(stream.Info.StreamStructFieldIndex).Id])).ResultId;\n                var inputResult = buffer.Add(new OpLoad(context.Types[stream.Info.Type], context.Bound++, stream.Id, null, [])).ResultId;","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Spirv/Processing/Interfaces/Generation/EntryPointWrapperGenerator.cs#L360-L396","documentation":"The generator maps the GeometryStreamType's output Kind to a SPIR-V output execution mode: GeometryStreamOutputKindSDSL.Point → OutputPoints, Line → OutputLineStrip, Triangle → OutputTriangleStrip. Any other Kind value throws this NotSupportedException, preventing emission of an OpExecutionMode that SPIR-V would reject. It means the stream output topology parsed from the shader is not one of the three supported kinds.","triggerScenarios":"A geometry stream output type whose GeometryStreamOutputKindSDSL.Kind is outside {Point, Line, Triangle} — e.g. an unresolved/default kind, a kind added by a newer SDSL version (such as stream-out variants), or a GeometryStreamType constructed programmatically with an invalid kind.","commonSituations":"Using a custom or newly added stream output kind in SDSL not yet mapped in wrapper generation; programmatic SPIR-V/SDSL construction setting Kind to a default value; version mismatch between the parser that produces the kind and the generator that consumes it.","solutions":["Use one of the supported output topologies in the GS: Point, Line (strip), or Triangle (strip) — adjust the stream type declaration accordingly","Check for a default/uninitialized Kind in custom GeometryStreamType construction and set it explicitly","If a new kind is required, add a mapping arm in EntryPointWrapperGenerator.cs to the appropriate SPIR-V ExecutionMode (e.g. OutputPoints/OutputLineStrip/OutputTriangleStrip or a newer mode)"],"exampleFix":"// before (unknown kind)\nvar streamType = new GeometryStreamType(GeometryStreamOutputKindSDSL.Unknown, elementType);\n// after\nvar streamType = new GeometryStreamType(GeometryStreamOutputKindSDSL.Triangle, elementType);","handlingStrategy":"type-guard","validationCode":"bool ok = outputStreamType.Kind is GeometryStreamOutputKindSDSL.Point\n    or GeometryStreamOutputKindSDSL.Line\n    or GeometryStreamOutputKindSDSL.Triangle;","typeGuard":"static bool IsSupportedOutputKind(GeometryStreamType t) => t.Kind is\n    GeometryStreamOutputKindSDSL.Point or GeometryStreamOutputKindSDSL.Line\n    or GeometryStreamOutputKindSDSL.Triangle;","tryCatchPattern":"try { wrapperGen.GenerateWrapper(...); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Unsupported geometry stream output kind\"))\n{\n    // report: GS output topology kind not in {Point, Line, Triangle}\n}","preventionTips":["Declare GS outputs as point list, line strip, or triangle strip only","Set GeometryStreamOutputKindSDSL.Kind explicitly when constructing GeometryStreamType programmatically","Guard the kind before generation and fail early with a clear message"],"tags":["shader-compilation","spirv","geometry-shader","unsupported-value","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-15T23:17:13.987Z"}