{"record":{"id":"ed49e43a68b92bb3","repo":"stride3d/stride","slug":"funct-not-supported-for-thistype","errorCode":null,"errorMessage":"$funcT not supported for {thisType}","messagePattern":"\\$funcT not supported for (.+?)","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/IntrinsicTemplateExpander.cs","lineNumber":242,"sourceCode":"                                parameterTypeHelper[index].BaseType = thisType switch\n                                {\n                                    TextureType t => t.ReturnType.GetElementType(),\n                                    BufferType b => b.BaseType.GetElementType(),\n                                    AppendStructuredBufferType b => b.BaseType,\n                                    ConsumeStructuredBufferType b => b.BaseType,\n                                    StructuredBufferType b => b.BaseType,\n                                    null => throw new ArgumentNullException(nameof(thisType)),\n                                    _ => throw new InvalidOperationException($\"Can't resolve thisType base type for {thisType}\"),\n                                };\n                            }\n                            else if (matchBaseTypeIndex == -3)\n                            {\n                                // Match funcT base type\n                                parameterTypeHelper[index].BaseType = thisType switch\n                                {\n                                    ByteAddressBufferType => ScalarType.UInt,\n                                    null => throw new ArgumentNullException(nameof(thisType)),\n                                    _ => throw new NotImplementedException($\"$funcT not supported for {thisType}\"),\n                                };\n                            }\n                            else\n                            {\n                                parameterTypeHelper[index].BaseType = parameterTypeHelper[matchBaseTypeIndex].BaseType;\n                            }\n                        }\n                    }\n\n                    // Now, iterate on size permutations\n                    bool firstIteration = true;\n                    foreach (var sizePermutationList in sizePermutations)\n                    {\n                        // Reset Sizes\n                        for (var index = 0; index < intrinsicDefinition.Parameters.Length + 1; index++)\n                        {\n                            parameterTypeHelper[index].Size1 = default;\n                            parameterTypeHelper[index].Size2 = default;","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/IntrinsicTemplateExpander.cs#L224-L260","documentation":"When a parameter's match index is -3 (match $funcT base type), only ByteAddressBufferType has a defined mapping (to ScalarType.UInt). Any other thisType reaching this branch triggers this NotImplementedException at expansion time.","triggerScenarios":"An intrinsic declared with intrin(..., $funcT) style matching (index -3) invoked with thisType being a Texture*, StructuredBuffer, regular Buffer, or any non-ByteAddressBuffer type.","commonSituations":"Reusing a $funcT-parameterized intrinsic (typically word-addressed buffer helpers) on structured or typed resources.","solutions":["Only invoke $funcT-parameterized intrinsics on ByteAddressBuffer values","If you control the intrinsic declaration, change the parameter from $funcT to an explicit type (e.g. uint)","File/patch upstream to add switch cases for additional types if support is genuinely needed"],"exampleFix":"// before\nuint word = myStructuredBuffer.Load$funcT(offset);\n// after\nuint word = myByteAddressBuffer.Load(offset);","handlingStrategy":"validation","validationCode":"if (paramMatchIndex == -3 && thisType is not ByteAddressBufferType)\n    throw new NotSupportedException($\"$funcT intrinsic requires ByteAddressBuffer, got {thisType}\");","typeGuard":"bool SupportsFuncT(TypeBase t) => t is ByteAddressBufferType;","tryCatchPattern":"try { Expand(intrinsic, thisType); }\ncatch (NotImplementedException ex) when (ex.Message.Contains(\"$funcT not supported\")) { /* fall back to explicit-type intrinsic */ }","preventionTips":["Use $funcT intrinsics only with ByteAddressBuffer","Prefer explicit scalar parameter types over $funcT in new intrinsic declarations","Document $funcT restrictions in the .sdsl file"],"tags":["sdsl","shaders","funct","not-implemented"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}