stride3d/stride · error · NotSupportedException

Unsupported geometry stream type

Error message

Unsupported geometry stream type '{Name}'

What it means

Thrown when resolving a generic type name that is known to be a geometry stream type (PointStream/LineStream/TriangleStream family) but whose Name matches none of the supported geometry stream output kinds. The switch maps the name to a GeometryStreamOutputKindSDSL value and has no default mapping for other names.

Solutions

  1. Correct the stream type name in the shader to PointStream, LineStream, or TriangleStream
  2. Check the geometry shader stage usage — only those three output kinds are supported
  3. If a new stream kind is genuinely needed, add a mapping to the switch and to GeometryStreamOutputKindSDSL

Example fix

// before
GeometryStream<float4> vertMain(PointStream<float4> input)
// after
GeometryStream<float4> vertMain(TriangleStream<float4> input)
Defensive patterns

Strategy: validation

Validate before calling

var valid = new[] { "PointStream", "LineStream", "TriangleStream" };
if (!valid.Contains(typeName.Name))
    throw new NotSupportedException($"'{typeName.Name}' is not a supported geometry stream type");

Type guard

bool IsGeometryStream(string name) => name is "PointStream" or "LineStream" or "TriangleStream";

Try / catch

try { ResolveType(table, context); }
catch (NotSupportedException ex) { table.AddError(new(info, ex.Message)); }

Prevention

When it happens

Trigger: Resolving a TypeName with geometry-stream semantics whose Name is not exactly PointStream, LineStream, or TriangleStream (e.g. custom or misspelled stream type names passed as Generics[0]-carrying generic types).

Common situations: Typos like PointsStream or TriangleStreams in shader source; shader dialects/HLSL extensions with extra stream types not supported by the SPIR-V backend; internal callers passing wrong names into type resolution.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/75d4f472ccc6b488. Report an issue: GitHub.

Appendix: source

Thrown at sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/Literals.cs:727

            var fullTypeName = GenerateTypeName(includeGenerics: true, includeArray: false);
            if (table.DeclaredTypes.TryGetValue(fullTypeName, out symbolType))
            {

            }
            else if (table.DeclaredShaders.TryGetValue(fullTypeName, out var shaderDef))
            {
                symbolType = new ShaderSymbol(shaderDef.Name, shaderDef.GenericArguments);
                // Ensure the shader is imported in the current context so shaderImportIds has an entry
                context.GetOrImportShader(shaderDef);
            }
            else if (Name == "PointStream" || Name == "LineStream" || Name == "TriangleStream")
            {
                symbolType = new GeometryStreamType(((TypeName)Generics[0]).ResolveType(table, context), Name switch
                {
                    "PointStream" => Specification.GeometryStreamOutputKindSDSL.Point,
                    "LineStream" => Specification.GeometryStreamOutputKindSDSL.Line,
                    "TriangleStream" => Specification.GeometryStreamOutputKindSDSL.Triangle,
                    _ => throw new NotSupportedException($"Unsupported geometry stream type '{Name}'"),
                });
            }
            else if (Name == "InputPatch" || Name == "OutputPatch")
            {
                symbolType = new PatchType(((TypeName)Generics[0]).ResolveType(table, context), Name switch
                {
                    "InputPatch" => Specification.PatchTypeKindSDSL.Input,
                    "OutputPatch" => Specification.PatchTypeKindSDSL.Output,
                    _ => throw new NotSupportedException($"Unsupported patch type '{Name}'"),
                }, ((NumberLiteral)Generics[1]).IntValue);
            }
            else if (SymbolType.TryGetNumeric(Name, out var numeric))
            {
                table.DeclaredTypes.Add(fullTypeName, numeric);
                symbolType = numeric;
            }
            else if (!IsArray && Generics.Count == 0 && SymbolType.TryGetBufferType(Name, null, out var bufferType))
            {

View on GitHub (pinned to 96fad776d2)