{"record":{"id":"38adc8e02547e080","repo":"stride3d/stride","slug":"unsupported-this-type-thistype-for-parameter-info","errorCode":null,"errorMessage":"Unsupported this-type {thisType} for parameter info","messagePattern":"Unsupported this-type (.+?) for parameter info","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/IntrinsicTemplateExpander.cs","lineNumber":291,"sourceCode":"                                        parameterTypeHelper[location.SourceArgument].Size2 = new(sizePermutation.Size, sizePermutation.Generator);\n                                        break;\n                                }\n                            }\n                        }\n\n                        ParameterTypeInfo GetParameterInfo(int index)\n                        {\n                            if (index == -1)\n                            {\n                                return thisType switch\n                                {\n                                    null => throw new ArgumentNullException(nameof(thisType)),\n                                    TextureType t => new(t.ReturnType.GetElementType(), new(t.ReturnType.GetElementCount(), null), default),\n                                    BufferType b => new(b.BaseType.GetElementType(), new(b.BaseType.GetElementCount(), null), default),\n                                    AppendStructuredBufferType b => new(b.BaseType, new(1, null), default),\n                                    ConsumeStructuredBufferType b => new(b.BaseType, new(1, null), default),\n                                    StructuredBufferType b => new(b.BaseType, new(1, null), default),\n                                    _ => throw new NotSupportedException($\"Unsupported this-type {thisType} for parameter info\"),\n                                };\n                            }\n                            if (index == -3)\n                            {\n                                return thisType switch\n                                {\n                                    null => throw new ArgumentNullException(nameof(thisType)),\n                                    ByteAddressBufferType => new(ScalarType.UInt, new(1, null), default),\n                                    _ => throw new NotImplementedException($\"$funcT not supported for {thisType}\"),\n                                };\n                            }\n                            return parameterTypeHelper[index];\n                        }\n\n                        // Use match() to fill size info\n                        for (var index = 0; index < intrinsicDefinition.Parameters.Length + 1; index++)\n                        {\n                            var parameterType = index > 0 ? intrinsicDefinition.Parameters[index - 1].Type : intrinsicDefinition.Return;","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/IntrinsicTemplateExpander.cs#L273-L309","documentation":"While building parameter info (element type + size) for an intrinsic parameter matched against thisType (index -1), the expander only knows how to describe textures, constant/typed buffers, and structured buffers. Any other thisType is rejected with this NotSupportedException.","triggerScenarios":"An intrinsic parameter using match(thisType) invoked on a type outside the supported set: scalars, vectors, matrices, custom structs, or ByteAddressBuffer (handled only for index -3).","commonSituations":"Applying resource-parameterized intrinsics (e.g. Load/Sample helpers) to non-resource types; SDSL generic intrinsics bound to unexpected argument types at a call site.","solutions":["Ensure the call site passes a supported resource type (Texture, Buffer, StructuredBuffer, Append/ConsumeStructuredBuffer)","Restrict the intrinsic declaration so only resource types can match","Add a case in the switch if a new resource kind must be supported"],"exampleFix":"// before\nfloat4 c = myVector.Load(i);\n// after\nfloat4 c = myTexture.Load(int2(i, 0));","handlingStrategy":"validation","validationCode":"if (paramMatchIndex == -1 && thisType is not (TextureType or BufferType or StructuredBufferType or AppendStructuredBufferType or ConsumeStructuredBufferType))\n    throw new NotSupportedException($\"{thisType} unsupported for thisType-parameterized intrinsic\");","typeGuard":"bool SupportsThisTypeMatch(TypeBase t) => t is TextureType or BufferType or StructuredBufferType or AppendStructuredBufferType or ConsumeStructuredBufferType;","tryCatchPattern":"try { Expand(intrinsic, thisType); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Unsupported this-type\")) { /* surface the unsupported call site */ }","preventionTips":["Validate call-site argument types against the intrinsic's supported thisTypes","Restrict generic intrinsics via declarations so unsupported types cannot bind","Add compile-time checks in shader macros that wrap resource intrinsics"],"tags":["sdsl","shaders","this-type","parameter-info"],"backgroundTag":"unsupported-operation","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"}