bevy: PBR not working in Safari >= 15.1 on M1 GPUs

Bevy version

main or >= 0.6

Operating system & version

macOS 12.1

What you did

Run any PBR bevy app in wasm on Safari >= 15.1 on an M1 mac.

What you expected to happen

App renders correctly in the Safari tab.

What actually happened

Safari tab hangs.

Additional information

This was narrowed down to being because of dynamically indexing into fixed-size arrays in uniform buffers. This is done as part of the clustered-forward rendering.

Disabling “WebGL via Metal” allows the app to render correctly.

This seems to be a bug somewhere in Safari / WebKit / ANGLE / Metal / M1 drivers. A bug was filed here: https://bugs.webkit.org/show_bug.cgi?id=234926

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 20 (11 by maintainers)

Most upvoted comments

Same for me on macOS 13.3 with Safari Version 16.4 (18615.1.26.11.22) on M1 Max. Yey! Closing…

this is now fixed with today iOS / macOS release for me 🎉

@jinleili yeah, this was a regression introduced when they switched to using ANGLE as their backend to support WebGL2 via Metal. But we cannot expect users of web pages to enable developer options and change that setting. It has to work in Safari with its default configuration.

EU is hopefully implementing a fix of forcing apple to ship chrome and Firefox on iOS.

On Tue, 28 Feb 2023 at 05:59, rainroar @.***> wrote:

Since this has gone so long without a fix from Apple would it make sense for bevy to implement a workaround?

I don’t have a ton of experience with the engine but I’d be willing to look into it if there’s appetite. 3D not working in safari is a deal breaker for me 🫠

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/3574#issuecomment-1447628376, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEJCBCYG6DSV5B65VQJ4TWZWH3HANCNFSM5LNBP4WQ . You are receiving this because you commented.Message ID: @.***>

Pretty sure that is not possible. This kind of internal browser preferences are normally not writeable by web pages.

This is the error I get on both iOS and MacOS safari: WebGL: INVALID_ENUM: framebufferTexture2D: invalid attachment

On the WebKit bug tracker it was noted that it’s possible that the binding becomes too large after some intermediate processing. I tried reducing the binding sizes to 16000 bytes and even 8000 bytes to test the theory. It did not help, still broken, the tab still hangs and never manages to draw a single frame.