WebGL linkProgram fails for every program in a Mac Catalyst WKWebView on macOS 27.3 beta

On macOS 27.3 beta (26C5035r), WebGL draws nothing in a WKWebView in a Mac Catalyst app. A WebGL2 context is created and shaders pass COMPILE_STATUS, but linkProgram fails for every program, with LINK_STATUS false and an empty program log.

The same source file draws when built for My Mac. The same page also draws in Safari 27.3 and in the iOS 27.0 Simulator. Only the Mac Catalyst build fails.

To reproduce, run a trivial vertex and fragment shader pair in a WKWebView, built for My Mac (Mac Catalyst):

LINK_STATUS: false
program log: ""
pixel: 0, 0, 0, 0
getError: 1282

The unified log for the Catalyst app's com.apple.WebKit.GPU process shows this for each shader:

(Metal) Metal Compiling Shader
(Metal) Compiler failed to build request

MTLCompilerService logs "Compilation BEGIN" for each request, then no "Compilation SUCCESS". The Metal source from WEBGL_debug_shaders is byte-identical in the Mac and Catalyst views, and with ANGLE's link placeholders filled in by hand it compiles in a Catalyst process, so the failure seems specific to the Catalyst GPU process.

Signing, app sandbox, hardened runtime and a new bundle identifier make no difference. A macOS bundle loaded into the Catalyst process does not help, because its WKWebView is the Catalyst one.

Sketchy Workaround: run the page in an AppKit WKWebView in a separate macOS helper process.

FB25444425

Answered by DTS Engineer in 917733022

Thanks for FB25444425, with its comparison against a native Mac build, Safari, and Simulator. FB25440938 adds an iPad app running on a Mac, and the problem still happens in beta 2. Both reports are open and under investigation.

Please continue to test your software in release and pre-release versions of system software made available to you through your developer.apple.com account. When you do, add details about that into your bug report to keep it up to date. Please see developer.apple.com/download.

If WebGL draws nothing in your WKWebView in the macOS 27.3 beta, please file your own report using Feedback Assistant. Include a sysdiagnose captured while the problem is happening, which the Profiles and Logs page explains how to capture. Say whether your app is a Mac Catalyst app or an iPad app running on a Mac. Then post your FB number here so we can make sure it gets routed to the right team.

To see your page's console output and debug its JavaScript, set isInspectable to true on the web view, then select it in the Safari Develop menu.

I can't comment on future releases, and I don't have a workaround to suggest for iPad apps running on a Mac. I know that leaves your classroom view black for people running the beta.

Same failure here, but with an iPad app running on Apple silicon ("Designed for iPad"), not Catalyst. So this affects every WKWebView that uses the iOSSupport WebKit, and it still reproduces on 27.3 beta 2 (26C5047e).

Setup

  • Mac16,1 (M4). App: PlanningCharts (com.apollodor.planningcharts), a WKWebView that loads a MapLibre GL JS page through a WKURLSchemeHandler.
  • Worked on macOS 27.2 on the same machine. Broke with the update to 27.3 beta 1 (26C5035r), still broken on beta 2.
  • WebGL in Safari on the same Mac works.

What we see

  • WebGL 2: the context is created, then every program fails ("Could not compile fragment shader" / "Program failed to link"), and the info log is empty. A WebGL 1 context draws nothing either.
  • The unified log shows two sandbox denials for the app's com.apple.WebKit.GPU process right at its start, before the first shader fails (captured on beta 1, paths shortened, "…/C" is DARWIN_USER_CACHE_DIR):

deny file-issue-extension (read-write) …/C/com.apple.WebKit.GPU+com.apollodor.planningcharts/com.apple.WebKit.GPU/com.apple.metalfe
deny file-issue-extension (read-write) …/C/com.apple.WebKit.GPU+com.apollodor.planningcharts/com.apple.WebKit.GPU/com.apple.gpuarchiver

A possible explanation for "Compilation BEGIN" without "Compilation SUCCESS"
The GPU process is not allowed to hand its Metal cache directories to MTLCompilerService. In the open-source WebKit tree:

  • The iOS-family UI process issues a read-write extension only for <container>/Library/Caches/com.apple.WebKit.GPU (GPUProcessProxy.cpp, containerCachesDirectoryExtensionHandle).
  • The iOS-family GPU sandbox profile lets the GPU process re-issue extensions only for paths it already holds an extension for (com.apple.WebKit.GPU.sb.in, read-write-and-issue-extensions).
  • MTLSetShaderCachePath(containerCachesDirectory) is only called under USE(EXTENSIONKIT) (GPUProcessCocoa.mm).
    The denied paths are under DARWIN_USER_CACHE_DIR, which that extension does not cover. I have not checked whether the same denials are logged on 27.2, so this is a lead, not a proof.

Could you check whether your Catalyst GPU process logs the same two denials? This shows them at app launch:

log stream --style compact --predicate 'eventMessage CONTAINS "file-issue-extension" AND eventMessage CONTAINS "com.apple.WebKit.GPU"'

Also seen on the same build, possibly related: the app's WebContent process fails to decode almost every WebP image (ImageIO: 'WEBP'-_reader->initImage[0] failed err=-50).

Our feedback: FB25440938.

We’re seeing a similar black-screen issue in our app on macOS 27.3 beta, including build 26C5035r.

Our app embeds a web-based classroom in WKWebView and is being used on Macs. Affected users report that the entire classroom area remains black.

From our logs:

  • The web project finishes initialization and resources load successfully.
  • JavaScript, lesson signaling, and audio-related callbacks continue.
  • The update loop remains active at approximately 30 FPS.
  • Video first-frame callbacks are received, although these do not prove that the content is visible.

The common factor across the affected users is that they have upgraded to macOS 27.3 beta. The symptoms closely resemble the WKWebView/WebGL issue described here, so we suspect a rendering compatibility regression in this OS version.

Has anyone found a reliable workaround or confirmed a fixed build?

Is there an app-side workaround for iPad apps running on Apple silicon that avoids moving rendering into a separate native macOS helper process?

Any recommended diagnostics or updates on this issue would also be greatly appreciated.

Thanks!

Thanks for FB25444425, with its comparison against a native Mac build, Safari, and Simulator. FB25440938 adds an iPad app running on a Mac, and the problem still happens in beta 2. Both reports are open and under investigation.

Please continue to test your software in release and pre-release versions of system software made available to you through your developer.apple.com account. When you do, add details about that into your bug report to keep it up to date. Please see developer.apple.com/download.

If WebGL draws nothing in your WKWebView in the macOS 27.3 beta, please file your own report using Feedback Assistant. Include a sysdiagnose captured while the problem is happening, which the Profiles and Logs page explains how to capture. Say whether your app is a Mac Catalyst app or an iPad app running on a Mac. Then post your FB number here so we can make sure it gets routed to the right team.

To see your page's console output and debug its JavaScript, set isInspectable to true on the web view, then select it in the Safari Develop menu.

I can't comment on future releases, and I don't have a workaround to suggest for iPad apps running on a Mac. I know that leaves your classroom view black for people running the beta.