{"record":{"id":"fc0e52a825e4baa5","repo":"stride3d/stride","slug":"exception-of-type-system-notimplementedexception-was-thrown","errorCode":null,"errorMessage":"Exception of type 'System.NotImplementedException' was thrown.","messagePattern":"Exception of type 'System\\.NotImplementedException' was thrown\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/TextureMethodsImplementations.cs","lineNumber":338,"sourceCode":"    {\n        if (status != null)\n            throw new NotImplementedException();\n        return CompileGatherDref(table, context, builder, functionType, texture, s, x, compareValue, o, location);\n    }\n\n    public override SpirvValue CompileGatherCmpRed(SymbolTable table, SpirvContext context, SpirvBuilder builder, FunctionType functionType, SpirvValue texture, SpirvValue s, SpirvValue x, SpirvValue compareValue, SpirvValue? o = null, SpirvValue? o1 = null, SpirvValue? o2 = null, SpirvValue? o3 = null, SpirvValue? o4 = null, SpirvValue? status = null, TextLocation location = default)\n    {\n        if (status != null)\n            throw new NotImplementedException();\n        if (o1 != null)\n            return CompileGatherDrefConstOffsets(table, context, builder, functionType, texture, s, x, compareValue, o1.Value, o2!.Value, o3!.Value, o4!.Value, location);\n        return CompileGatherDref(table, context, builder, functionType, texture, s, x, compareValue, o, location);\n    }\n\n    public override SpirvValue CompileGatherCmpGreen(SymbolTable table, SpirvContext context, SpirvBuilder builder, FunctionType functionType, SpirvValue texture, SpirvValue s, SpirvValue x, SpirvValue compareValue, SpirvValue? o = null, SpirvValue? o1 = null, SpirvValue? o2 = null, SpirvValue? o3 = null, SpirvValue? o4 = null, SpirvValue? status = null, TextLocation location = default)\n    {\n        if (status != null)\n            throw new NotImplementedException();\n        if (o1 != null)\n            return CompileGatherDrefConstOffsets(table, context, builder, functionType, texture, s, x, compareValue, o1.Value, o2!.Value, o3!.Value, o4!.Value, location);\n        return CompileGatherDref(table, context, builder, functionType, texture, s, x, compareValue, o, location);\n    }\n\n    public override SpirvValue CompileGatherCmpBlue(SymbolTable table, SpirvContext context, SpirvBuilder builder, FunctionType functionType, SpirvValue texture, SpirvValue s, SpirvValue x, SpirvValue compareValue, SpirvValue? o = null, SpirvValue? o1 = null, SpirvValue? o2 = null, SpirvValue? o3 = null, SpirvValue? o4 = null, SpirvValue? status = null, TextLocation location = default)\n    {\n        if (status != null)\n            throw new NotImplementedException();\n        if (o1 != null)\n            return CompileGatherDrefConstOffsets(table, context, builder, functionType, texture, s, x, compareValue, o1.Value, o2!.Value, o3!.Value, o4!.Value, location);\n        return CompileGatherDref(table, context, builder, functionType, texture, s, x, compareValue, o, location);\n    }\n\n    public override SpirvValue CompileGatherCmpAlpha(SymbolTable table, SpirvContext context, SpirvBuilder builder, FunctionType functionType, SpirvValue texture, SpirvValue s, SpirvValue x, SpirvValue compareValue, SpirvValue? o = null, SpirvValue? o1 = null, SpirvValue? o2 = null, SpirvValue? o3 = null, SpirvValue? o4 = null, SpirvValue? status = null, TextLocation location = default)\n    {\n        if (status != null)\n            throw new NotImplementedException();","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/TextureMethodsImplementations.cs#L320-L356","documentation":"CompileGatherCmpGreen implements the SPIR-V backend for TextureGatherCmp with green-component results. It supports optional offsets variants but does not implement the 'status' (query-fragment) parameter; if a non-null status value is supplied it throws NotImplementedException. The bare message is the default NotImplementedException text.","triggerScenarios":"Calling GatherCmpGreen (or the mapped texture.gatherRed/green comparison API) while passing a status/result-fragment argument, e.g. an overload with a status output parameter.","commonSituations":"Porting HLSL gather_with_cmp_overloads that include the optional status parameter; automatic translation of HLSL intrinsic overloads to SDSL hitting an unimplemented path.","solutions":["Remove the status argument from the GatherCmpGreen call — use the plain or const-offsets overload instead.","Switch to an overload with offset parameters only (o1..o4) which is implemented via CompileGatherDrefConstOffsets.","If status support is required, implement it in CompileGatherCmpGreen (TextureMethodsImplementations.cs:334) rather than relying on the throw."],"exampleFix":"// before\nTexture2D.GatherCmpGreen(sampler, uv, dref, offset, status);\n// after\nTexture2D.GatherCmpGreen(sampler, uv, dref, offset); // status not supported","handlingStrategy":"try-catch","validationCode":"if (status != null) throw new NotSupportedException(\"GatherCmpGreen with status is not implemented in the SPIR-V backend\");","typeGuard":"bool StatusSupported => status is null;","tryCatchPattern":"try { result = impl.CompileGatherCmpGreen(table, context, builder, fnType, tex, s, x, dref, o, o1, o2, o3, o4, status); }\ncatch (NotImplementedException) { result = FallbackGatherWithoutStatus(); }","preventionTips":["Avoid the status-parameter GatherCmp overloads when targeting the SPIR-V backend.","Feature-detect backend capabilities before emitting intrinsic overloads.","Wrap intrinsic compilation to degrade gracefully instead of aborting the shader."],"tags":["spirv","shader-compilation","texture","not-implemented"],"backgroundTag":"method-not-implemented","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"}