The issue is still here with iOS 18.2.1 with Safari and Chrome on iPhone.
Indeed. Thanks for posting on this thread.
It looks like the situation is as follows:
- Apple originally shipped a regression in circa iOS Safari 16.6 that resulted in “WebGL Context Lost” errors being thrown.
- It was fixed in iOS 17.1, but…
- …we now learn that the fix that they landed in iOS 17.1 seems to have been only partial; or, there are multiple different root causes that can lead to iOS Safari throwing an error “WebGL Context Lost.”
(it is hard to say which, since it is possible that multiple distinct causes could result in same generic error message in Safari)
There has been a code change in Unity’s UIToolkit GPU shaders, where another bug was fixed by changing ‘int’ GLSL variables to use the ‘uint’ instead to produce the correct result. It looks like this seemingly innocent reading change has started to trigger Safari WebGL 2 implementation to crash.
This bug has been reported to Apple as ticket 286297 – "WebGL: context lost." on Unity WebAssembly/WebGL 2 content.
We are looking if there are other ways to fix the UIToolkit bug so that it would work around the Safari bug.
If you are experiencing Safari errors with “WebGL Context Lost” in projects that do not use any 2D UI in them (or e.g. the error persists even when removing all UI from the project), then it is likely that the root cause of that “WebGL Context Lost” error would be something different than the cause that we currently know Safari to suffer from. In such a case, please do report a separate bug or open a new thread about it.