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
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.