unoplatform/uno · error · InvalidOperationException

No function was found with the name {proc}.

Error message

No function was found with the name {proc}.

What it means

WinUINativeOpenGLWrapper.GetProcAddress resolves GL extension function pointers: it tries opengl32.dll's export table via NativeLibrary.TryGetExport, then wglGetProcAddress. If both return IntPtr.Zero it throws InvalidOperationException naming the missing proc. This happens when the GL implementation does not expose the requested extension/function — common on software renderers, older drivers, or when requesting a function the context's version/extensions don't provide.

Source

Thrown at src/AddIns/Uno.WinUI.Graphics3DGL/Windows/WinUINativeOpenGLWrapper.cs:98

	public bool TryGetProcAddress(string proc, out nint addr)
	{
		if (_opengl32.Value != IntPtr.Zero && NativeLibrary.TryGetExport(_opengl32.Value, proc, out addr))
		{
			return true;
		}

		addr = WindowsRenderingNativeMethods.wglGetProcAddress(proc);
		return addr != IntPtr.Zero;
	}

	public nint GetProcAddress(string proc)
	{
		if (TryGetProcAddress(proc, out var address))
		{
			return address;
		}

		throw new InvalidOperationException("No function was found with the name " + proc + ".");
	}

	public void Dispose()
	{
		if (WindowsRenderingNativeMethods.wglDeleteContext(_glContext) == 0)
		{
			if (this.Log().IsEnabled(LogLevel.Error))
			{
				this.Log().Error($"{nameof(WindowsRenderingNativeMethods.wglDeleteContext)} failed.");
			}
		}
		_glContext = default;
		_hdc = default;
	}

	public IDisposable MakeCurrent()
	{
		var glContext = WindowsRenderingNativeMethods.wglGetCurrentContext();

View on GitHub (pinned to 0418340488)

Solutions

  1. Ensure wglMakeCurrent succeeded before loading GL functions, and that the context is a modern (3.3+/4.x) one created with the right pixel format.
  2. Update GPU drivers to a version exposing the required extension.
  3. Make the GL loader tolerant of missing optional extensions and skip features whose procs are zero rather than throw.
Defensive patterns

Strategy: validation

Validate before calling

if (!wrapper.TryGetProcAddress(proc, out var addr) || addr == IntPtr.Zero) { /* extension unavailable; skip feature */ }

Type guard

static bool GlFunctionAvailable(WinUINativeOpenGLWrapper w, string proc) => w.TryGetProcAddress(proc, out var a) && a != IntPtr.Zero;

Prevention

When it happens

Trigger: Silk.NET requests a GL function (an extension entry point) that neither opengl32.dll exports nor wglGetProcAddress can resolve on the current context — because the extension is unsupported on this GPU/driver, or the GL context was not current at load time.

Common situations: Loading a GL >=3.0 function on a context that was created as legacy (pre-3.0 pixel format); running on a software renderer (llvmpipe, GDI generic) lacking the extension; querying a function before wglMakeCurrent.

Related errors


AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13). Data as JSON: /api/errors/4809a58b0a4ea6c4. Report an issue: GitHub.