Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari v15 (on desktop) -> threejs bug #22582

Closed
nicholaswagner opened this issue Sep 24, 2021 · 16 comments
Closed

Safari v15 (on desktop) -> threejs bug #22582

nicholaswagner opened this issue Sep 24, 2021 · 16 comments

Comments

@nicholaswagner
Copy link

As of Safari 15 (Desktop) something having to do with OpenGL causes a total browser failure.

(Sorry I don't have better information, feel free to delete this and create a more helpful ticket once more info becomes available)

A problem repeatedly occurred with "site url" [ reload webpage button ]

notes:

  • Mobile safari v15 works fine.
  • Chrome / Firefox browsers appear unaffected by whatever this is.

Live examples

Steps to reproduce the behavior:

  1. visit one of the following official three js showcase websites in safari v15 on OSX

Screenshots
Screen Shot 2021-09-24 at 11 22 04 AM

Platform:

  • Device: [Desktop]
  • OS: [MacOS]
  • Browser: [Safari]
@mrdoob
Copy link
Owner

mrdoob commented Sep 25, 2021

Better to report this to Apple directly:
https://webkit.org/reporting-bugs/

@mrdoob mrdoob closed this as completed Sep 25, 2021
@nicholaswagner
Copy link
Author

@mrdoob I feel like dad just told me to go ask my mother. ;P
Just filed the report, thanks!

@walpolea
Copy link

I found that enabling Develop > Experimental Features > GPU Process: WebGL in Safari 15 fixes the error. Why it's not enabled by default is a whole separate question, but I'm hoping this will get fixed by Apple soon.
webgl-flag

@walpolea
Copy link

One more update here. With GPU Process: WebGL turned off in Safari 15, and updating my project's three version to "0.132.2" (from "0.112.1") the error is fixed for me.

@61315
Copy link

61315 commented Sep 30, 2021

@walpolea Rollback to r112 really helped. All the anomalies brought by Safari on iOS 15 have disappeared. Thanks.

@skalexet
Copy link

skalexet commented Oct 6, 2021

One more update here. With GPU Process: WebGL turned off in Safari 15, and updating my project's three version to "0.132.2" (from "0.112.1") the error is fixed for me.

done :)

@willmorgan
Copy link

@mrdoob Could this be reopened? Even with the latest version of THREE and the WebGL: GPU Process enabled, it now seems that webcam textures are not being rendered.

Example from official site: https://threejs.org/examples/?q=webcam#webgl_materials_video_webcam

Try that in Safari 15 (with GPU process off, because if it's on, it crashes):

image

@mrdoob
Copy link
Owner

mrdoob commented Oct 8, 2021

@willmorgan We just can't do anything about it. This is a regression in Safari.

@willmorgan
Copy link

@mrdoob Alright, I get you.

@nicholaswagner What's your bugs.webkit ticket ID? Mine was: https://bugs.webkit.org/show_bug.cgi?id=231423

@nicholaswagner
Copy link
Author

@willmorgan I actually just posted it to the apple developers bug reporting page.
You posting it directly to the webkit project was a much better idea.

Webkit team has this issue fixed internally and it will ship in upcoming releases.

@pinktonio
Copy link

@walpolea That fixes the error.
What also fixes the error for me is enabling Develop > Experimental Features > WebGL via Metal

@dustinkerstein
Copy link

dustinkerstein commented Oct 20, 2021

@walpolea That fixes the error. What also fixes the error for me is enabling Develop > Experimental Features > WebGL via Metal

And somewhat unfortunately once you enable/disable that feature, I am no longer able to replicate the issue, even after restarting Safari. Luckily I have Safari Technical Preview installed so I can continue looking for a workaround for my production site. Has anyone found a viable code-based workaround? I'm on Three.js version 108.

@python1981
Copy link

@dustinkerstein For those why may be looking for a quick code-based workaround to avoid needing to upgrade threejs version, this worked for me...

In WebGLRenderer constructor:

  1. Remove xrCompatible from contextAttributes
  2. Attempt to create context with _canvas.getContext( 'webgl2', contextAttributes ) and only if unsuccessful, fallback to _canvas.getContext( 'webgl', contextAttributes ) because the webgl2 version should succeed on Safari Desktop which avoids hitting the second call which is where the crash occurs (in my old version 110 of threejs)

@nh2
Copy link
Contributor

nh2 commented Jan 11, 2022

Can anybody summarise the situation?

On https://bugs.webkit.org/show_bug.cgi?id=231423,

  • Some people claim that a THREE ugprade fixes it (if yes, which version and which commit?)
  • other say a Safari upgrade fixes it, simultaneously stating that that is not "GA and released"
  • others say it's unfixed
  • others say that xrCompatible: true causes the issue
  • others refer to a bug https://bugs.webkit.org/show_bug.cgi?id=229309 which apparently nobody has permissions to view

Meanwhile, in the latest iOS Safari 15.2 (as well as 15.1 and 15.0), I still see crashes that look like the one in the issue description.

@willmorgan
Copy link

@nh2 Hi Niklas, long time no speak (last time was some hack day in 2012...)

I am using "three": "0.133.1" in my SDK and this is no longer an issue.

However for various reasons I would recommend not supporting 15.0 of Safari as it seems to have been a botched release - Apple seems to have quickly put 15.1 out which solves this and other issues.

@nh2
Copy link
Contributor

nh2 commented Feb 1, 2022

Hi @willmorgan, didn't expect to meet you here :D Yes, on the Treevee project :D

I have figured it out now:

I had a separate bug in a shader that apparently also managed to make Safari crash the entire tab. Have not investigated it fully yet, only rolled back that shader change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants