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

HTML5 exports fail to run on macOS (CanvasShaderGLES3: Program linking failed) #68980

Closed
Luzzotica opened this issue Nov 21, 2022 · 13 comments · Fixed by #70065
Closed

HTML5 exports fail to run on macOS (CanvasShaderGLES3: Program linking failed) #68980

Luzzotica opened this issue Nov 21, 2022 · 13 comments · Fixed by #70065

Comments

@Luzzotica
Copy link

Godot version

4.0.beta5

System information

MacOS Monterey 12.2.1

Issue description

Building any godot application for web fails to load with the following error:

USER ERROR: CanvasShaderGLES3: Program linking failed
at: _display_error_with_code (drivers/gles3/shader_gles3.cpp:237)
USER ERROR: Method/function failed.
at: _compile_specialization (drivers/gles3/shader_gles3.cpp:397)

Steps to reproduce

Create any project using Godot 4.0 beta 5 official.

Add a button and link it to a print just to test things.

Run the project once to assign a root.

Build for html.

Deploy using some server. Itch.io is the easiest, just be sure to enable the SharedBufferArray.

Try to run the game. It will block after loading, and then crash with lots of errors, the above being the first.

Minimal reproduction project

Godot4WebExportFail.zip

@Calinou Calinou changed the title Building HTML5 app fails HTML5 exports fail to run (CanvasShaderGLES3: Program linking failed) Nov 21, 2022
@Calinou
Copy link
Member

Calinou commented Nov 21, 2022

Which browser(s) did you test? Can you test multiple browsers if you've only tried one?

@Luzzotica
Copy link
Author

I tested on Brave, Safari, and Chrome. Each had the same error.

@Luzzotica
Copy link
Author

Luzzotica commented Nov 22, 2022

As a side note, I tried building using my friend's windows laptop and got the same error from the site. That was built with Godot 4.0.beta3 however, not beta 5. Both seem to have the same issue.

If you want a live example of my game failing (Not a simple project), you can go here:
https://melodious-granita-9bfb98.netlify.app/

The game with load and then stall for a good 30 seconds to a minute before throwing the error.

@akien-mga akien-mga added this to the 4.0 milestone Nov 22, 2022
@akien-mga akien-mga moved this to To Assess in 4.x Priority Issues Nov 22, 2022
@clayjohn
Copy link
Member

As a side note, I tried building using my friend's windows laptop and got the same error from the site. That was built with Godot 4.0.beta3 however, not beta 5. Both seem to have the same issue.

If you want a live example of my game failing (Not a simple project), you can go here: https://melodious-granita-9bfb98.netlify.app/

The game with load and then stall for a good 30 seconds to a minute before throwing the error.

The only related errors I get running this sample scene are due to it using GPUParticles which weren't implemented yet in Beta3 but they are in Beta 5.

The fact that the error message you pointed to above is an error only with linking the Shader makes me think that the issue is also related to GPUParticles. Can you please check an example scene without GPUParticles and confirm whether you get the same error message? Apologies in advance, I don't have a macOS devices with which to test this

@Luzzotica
Copy link
Author

Luzzotica commented Nov 23, 2022

@clayjohn Alright, just tested with my test project above.
Built it, and deployed it here: https://melodious-granita-9bfb98.netlify.app/
Same error. I built from my macOS for the project above. I will try later using my friend's laptop (After updating to Godot 4.0 beta 5) on windows to see if that resolves the issue with the GPUParticles and allows me to run the app.

If that does resolve the GPUParticles, then this is a macOS build issue.

@YuriSizov YuriSizov moved this from To Assess to Todo in 4.x Priority Issues Nov 26, 2022
@Luzzotica
Copy link
Author

Some additional feedback for this:
If I build my game on windows, I can run my game on a windows machine, but not on macOS.
I haven't tested if I can build the game on macOS and run it on windows.

This seems to simply be an issue with macOS not being able to run my html5 game.

Any thoughts?

I hope my added details are helpful.

@Luzzotica Luzzotica changed the title HTML5 exports fail to run (CanvasShaderGLES3: Program linking failed) HTML5 exports fail to run on macOS (CanvasShaderGLES3: Program linking failed) Dec 1, 2022
@Calinou
Copy link
Member

Calinou commented Dec 1, 2022

This seems to simply be an issue with macOS not being able to run my html5 game.

macOS has different graphics drivers compared to Windows, and there is no native OpenGL support (WebGL uses OpenGL behind the scenes). Apple still provides OpenGL 4.1 support by translating OpenGL to Metal, but this comes with its own bugs and limitations.

@Luzzotica
Copy link
Author

Luzzotica commented Dec 2, 2022

That sounds like an inconclusive “We have no way to fix this”.

But that can’t be right. What are our options?

@clayjohn
Copy link
Member

clayjohn commented Dec 2, 2022

macOS has different graphics drivers compared to Windows, and there is no native OpenGL support (WebGL uses OpenGL behind the scenes). Apple still provides OpenGL 4.1 support by translating OpenGL to Metal, but this comes with its own bugs and limitations.

AFAIK this only happens on M1 and M2 systems. The older intel based Macs still attempt to run over ordinary OpenGL and the drivers are indeed very buggy.

That sounds like an inconclusive “We have no way to fix this”.

But that can’t be right. What are our options?

For starters, someone who can reproduce the bug needs to investigate further and determine what shader is failing to link (e.g. by process of elimination), then we need to identify what exactly is causing that shader to fail to link and figure out a workaround.

@Luzzotica
Copy link
Author

Luzzotica commented Dec 2, 2022

@clayjohn
I have an intel based Mac and it is still crashing. Guess those are the buggy drivers?

I know that the particles cause it to fail as mentioned above, but building the basic game in my first post also causes macOS to crash with tons of stuff printed out.

Here are the logs for one set of errors, if they are helpful. In this case it's the canvas rasterization...? There's a line number in there for a cpp file.
Errors.zip

I can also take a video if you'd like.

@david-landeros
Copy link

david-landeros commented Dec 2, 2022

I'm facing a similar issue on Godot 3.5-stable. on a Macbook pro M1 with GLES3

Browser Settings Result
Brave v1.46.133 Shader Compilation Mode: Async Crash at load, Program Linking failed
Brave v1.46.133 Shader Compilation Mode: Sync It works! :o
Safari 15.5 Shader Compilation Mode: Async Loads but displays 3d object completely black
Safari 15.5 Shader Compilation Mode: Sync Loads but displays 3d object completely black

GLES2 works on every combination, unfortunately my use case needs GLES3 since I'm depending on HDR.

@Luzzotica
Copy link
Author

Godot 4.0 beta 7 doesn't work on Macbook pro Intel.
Not sure if godot 4.0 has the Shader Compl. Mode. I was unable to find it.

@ztc0611
Copy link
Contributor

ztc0611 commented Dec 12, 2022

Still occurring on Beta 8. This issue seems to do nothing unless you attempt to access the debug console, in which case it crashes Firefox and Chrome, and freezes Safari. Prior to that just an endless spinning load icon. I have an M1 MacBook Pro (Late 2020).

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

Successfully merging a pull request may close this issue.

6 participants