stride3d/stride · error · InvalidOperationException
Can't find method group info for
Error message
Can't find method group info for {context.Names[function.ResultId]} What it means
When the mixer encounters an OpFunction immediately followed by OpFunctionMetadataSDSL, the function being defined must already have a method group registered under its result id in the mixin node. A missing entry means the function definition has no method-group metadata — an inconsistency between the function-definition pass and earlier method-group registration.
Solutions
- Recompile/rebuild the shaders so method-group registration and function metadata are consistent.
- Ensure the shader defining the function is properly composed into this mixin node.
- Check that the function was declared (not just defined) so its method group gets registered.
- If reproducible on fresh sources, report as a likely mixer bug with the SDSL sources attached.
Example fix
// before: function defined without prior declaration/metadata in the mixin
void UndeclaredFn() { ... }
// after: declare it so the method group is registered
void UndeclaredFn(); // declaration registers the method group
void UndeclaredFn() { ... } Defensive patterns
Strategy: try-catch
Validate before calling
// Every OpFunction with metadata must have a registered method group in the mixin
if (!mixinNode.MethodGroups.ContainsKey(functionResultId))
throw new InvalidOperationException($"Function '{name}' defined without method-group registration; rebuild shaders"); Try / catch
try { var mixed = mixer.Process(...); }
catch (InvalidOperationException ex) when (ex.Message.Contains("Can't find method group info"))
{
log.Error(ex, "Function definition lacks method-group metadata; rebuild shader caches, and report a mixer bug if reproducible from clean sources");
throw;
} Prevention
- Rebuild shader caches whenever SDSL sources or the Stride version change.
- Declare functions before/alongside definitions so method groups are registered.
- Avoid hand-editing intermediate compiled shader data.
- If it reproduces on clean sources, file a bug with the SDSL files and composition setup.
When it happens
Trigger: ShaderMixer constructor sees Op.OpFunction whose next op is OpFunctionMetadataSDSL; mixinNode.MethodGroups does not contain function.ResultId.
Common situations: Stale or hand-edited compiled shader bytecode missing metadata registration; the function was defined in a shader not properly registered into this mixin node; a mixing-pass ordering bug or cache mismatch between metadata and method groups.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Can't find method group info for
- Struct not found in shader
- Could not find compositions for expression
- External variable not found
- Can't find function in current mixin
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/9d72ef0d005fa946.
Report an issue: GitHub.
Appendix: source
Thrown at sources/shaders/Stride.Shaders.Compilers/SDSL/ShaderMixer.cs:1081
}
if ((selectedMethod.Flags & FunctionFlagsMask.Abstract) != 0)
throw new InvalidOperationException($"Trying to call an abstract method {selectedMethod.Shader.ShaderName}.{methodGroupEntry.Name}");
functionId = selectedMethod.MethodId;
memberAccesses.Add(memberAccess.ResultId, functionId);
}
else
{
throw new InvalidOperationException($"Member {memberAccess.Member} not found");
}
SetOpNop(i.Data.Memory.Span);
}
else if (i.Data.Op == Op.OpFunction && (OpFunction)i is { } function && temp[index + 1].Op == Op.OpFunctionMetadataSDSL && (OpFunctionMetadataSDSL)temp[index + 1] is { } functionInfo)
{
if (!mixinNode.MethodGroups.TryGetValue(function.ResultId, out var methodGroupEntry))
throw new InvalidOperationException($"Can't find method group info for {context.Names[function.ResultId]}");
}
else if (i.Data.Op == Op.OpFunctionEnd)
{
memberAccesses.Clear();
}
SpirvBuilder.RemapIds(memberAccesses, ref i.Data);
}
}
static void SetOpNop(Span<int> words)
{
words[0] = words.Length << 16;
words[1..].Clear();
}
public static void OffsetIds(OpData inst, int offset)View on GitHub (pinned to 96fad776d2)