Bug 264683 - "context lost" when getting WebGL context
Summary: "context lost" when getting WebGL context
Status: RESOLVED DUPLICATE of bug 264684
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 17
Hardware: iPhone / iPad iOS 17
: P2 Blocker
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-11 12:29 PST by Andre-John Mas
Modified: 2023-11-11 14:31 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andre-John Mas 2023-11-11 12:29:53 PST
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
Comment 1 Ahmad Saleem 2023-11-11 14:31:53 PST

*** This bug has been marked as a duplicate of bug 264684 ***