Bug 264684
Summary: | "context lost" when getting WebGL context | ||
---|---|---|---|
Product: | WebKit | Reporter: | Andre-John Mas <andrejohn.mas> |
Component: | WebGL | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Blocker | CC: | dino, kbr, kkinnunen, zalcik.lukas |
Priority: | P2 | ||
Version: | Safari 17 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 17 |
Andre-John Mas
We are no longer able to get the WebGL context on iOS or iPadOS using release 17, with a "context lost" error being logged.
The issues was discovered using Three.JS, but further investigation reveals this impacts all WebGL applications (those I have tested with).
The following code is enough to cause the issue:
```
function initWebGL () {
const canvas = document.querySelector('#canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const glOptions = {
// antialias: false,
// alpha: false,
// premultipliedAlpha: false
};
const gl = canvas.getContext('webgl2', glOptions)
|| canvas.getContext('webgl', glOptions)
|| canvas.getContext('experimental-webgl', glOptions);
}
initWebGL();
```
Note, this does not impact Safari (17.0 (19616.1.27.211.1)) on MacOS X 14.
Tested with: iOS 17.0.3, iPadOS 17.0.3 and MacOSX 14 (Safari).
Note, discussion in the Three.JS forum: https://discourse.threejs.org/t/three-js-broken-on-ios-17-with-context-lost/58025
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Andre-John Mas
I was just reminded there was updates for iPadOS and iOS.
Confirm this is no longer an issue with iPadOS 17.1.1 or 17.1.1
I'll close this ticket.
Ahmad Saleem
*** Bug 264683 has been marked as a duplicate of this bug. ***
zakyn
We are still experiencing this issue on iOS 17.1.2 phones
Andre-John Mas
@zakyn can you provide some code that illustrates the issue and at what line you are seeing this occur. Thanks