diff --git a/src/Core/Silk.NET.Core/Contexts/MultiNativeContext.cs b/src/Core/Silk.NET.Core/Contexts/MultiNativeContext.cs index 223a7e5845..bdf9dbfea8 100644 --- a/src/Core/Silk.NET.Core/Contexts/MultiNativeContext.cs +++ b/src/Core/Silk.NET.Core/Contexts/MultiNativeContext.cs @@ -4,6 +4,7 @@ #nullable enable using System; using System.Linq; +using Silk.NET.Core.Loader; namespace Silk.NET.Core.Contexts { @@ -30,16 +31,13 @@ public MultiNativeContext(params INativeContext?[] contexts) /// public nint GetProcAddress(string proc, int? slot = default) { - foreach (var nativeContext in Contexts) + if (!TryGetProcAddress(proc, out var ret, slot)) { - var ret = nativeContext?.GetProcAddress(proc, slot) ?? default; - if (ret != default) - { - return ret; - } + static void Throw(string fn) => throw new SymbolLoadingException(fn); + Throw(proc); } - return default; + return ret; } ///