Bug 237658 - [GODOT] Internal error compiling shader with Metal backend.
Summary: [GODOT] Internal error compiling shader with Metal backend.
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 15
Hardware: Mac (Intel) macOS 12
: P2 Critical
Assignee: Nobody
URL: https://scopema.dev.unova.fr
Keywords: InRadar
Depends on:
Blocks: 242297
  Show dependency treegraph
 
Reported: 2022-03-09 08:21 PST by Florian RICHER
Modified: 2024-01-17 02:02 PST (History)
9 users (show)

See Also:


Attachments
Full Console log (436.35 KB, text/plain)
2022-03-09 08:21 PST, Florian RICHER
no flags Details
Cleaned shader from web console (51.52 KB, text/plain)
2022-07-01 06:12 PDT, Florian RICHER
no flags Details
Minimal project to reproduce error (13.57 MB, application/zip)
2022-07-01 08:51 PDT, Florian RICHER
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian RICHER 2022-03-09 08:21:41 PST
Created attachment 454240 [details]
Full Console log

When i try start private godot game, it crash during loading.

See attachment for more information.
Comment 1 Radar WebKit Bug Importer 2022-03-10 10:19:45 PST
<rdar://problem/90106648>
Comment 2 Kimmo Kinnunen 2022-03-10 11:05:46 PST
Thanks for the report. Could you comment on which device and OS version you see this.
Thanks!
Comment 3 Florian RICHER 2022-03-15 04:26:07 PDT
I try only on intel macbook with mac os x 11 and 12.
Comment 4 Jais Steuer 2022-04-04 14:20:18 PDT
Have the same issue with a website aka game Tanki online at: https://tankionline.com/play (safari) it loads but then says there is an error with the backend.
-
iPhone SE 2020 App: Safari. Date: 04/04/22 time 14:19 UTC-7. JAIS STEUER.
Comment 5 Kimmo Kinnunen 2022-05-23 03:47:31 PDT
Florian, would you have a link to content that would reproduce the issue?
The link https://scopema.dev.unova.fr gives me 502 Bad Gateway
Comment 6 Florian RICHER 2022-06-03 07:04:53 PDT
Try this link https://configurateur.scopema.com/ .
It's the production link and not dev link
Comment 7 Florian RICHER 2022-06-30 08:46:36 PDT
This error is generate when godot try Link shader to program here https://github.com/godotengine/godot/blob/3.4/drivers/gles3/shader_gles3.cpp#L449
Comment 8 Kimmo Kinnunen 2022-07-01 05:57:32 PDT
Thanks for the link.
It would be useful if you can figure out the shader that the engine is trying to link.
If you are able to generate a simple project that uses that shader and attach that, it would be even more useful.
Comment 9 Florian RICHER 2022-07-01 06:00:41 PDT
You can see the shader in Full Console.log attached to issue.

It Begin by "[Log]    {LINE_NUMBER} |"
Comment 10 Florian RICHER 2022-07-01 06:12:43 PDT
Created attachment 460606 [details]
Cleaned shader from web console

It's the cleaned shader from "Full Console.log" attachment.

It can contain error because we clean log with a python script
Comment 11 Florian RICHER 2022-07-01 08:51:01 PDT
Created attachment 460615 [details]
Minimal project to reproduce error

I send you minimal project created with Godot.

Attachment contain 2 folders:
  - godot_project : Project created with this version of Godot https://github.com/godotengine/godot/releases/download/3.4.4-stable/Godot_v3.4.4-stable_mono_osx.universal.zip
  - exported_html : Debug export of project

To export manually project from Godot:

  - Unzip file where you want
  - Install Godot from url in above
  - Open godot
  - Click in "Import" button in the right panel
  - Click in "Browse" button
  - Select file PATH/godot_project/project.godot
  - Click in "Open" button
  - Click in "Import and Edit" button
  - When project is open, click in "Project" menu item
  - Click in "Export" button, "HTML5 (Executable)", "Export project" and select the path to export project

If Godot ask you to download "export template", you must download it and re export the project.
Comment 12 Kyle Piddington 2022-07-01 18:01:27 PDT
Was able to reproduce, issue appears to be related to SeperateCompoundExpressions pass.
Comment 13 Kyle Piddington 2022-07-07 09:50:08 PDT
I've been able to write a fix and a test here for this failure:
https://chromium-review.googlesource.com/c/angle/angle/+/3751106/1

The first issue in play is a uniform block being used in a ternary statement, a weird edge case we hadn't considered. 

Unfortunately, even with this fix, we're still seeing issues with Godot due to over-use of local registers. I'm working on a fix at the moment to reduce register pressure.

Once https://chromium-review.googlesource.com/c/angle/angle/+/3751106/1 lands, I expect compilation will pass, but we'll still see runtime or compilation backend failure due to using too many local variables.
Comment 14 Florian RICHER 2022-07-21 03:29:43 PDT
Hi, 

Do you know when you will be able to inform us about a patch will fix the problem ? 
And, for the time being have you a solution to bypass the problem ?
In fact, our platform configurator is completely broken in IOS devices.
Thanks in advance for you reply.
Comment 15 Florian RICHER 2023-04-03 03:52:25 PDT
@Kyle Piddington(In reply to Kyle Piddington from comment #13)
> I've been able to write a fix and a test here for this failure:
> https://chromium-review.googlesource.com/c/angle/angle/+/3751106/1
> 
> The first issue in play is a uniform block being used in a ternary
> statement, a weird edge case we hadn't considered. 
> 
> Unfortunately, even with this fix, we're still seeing issues with Godot due
> to over-use of local registers. I'm working on a fix at the moment to reduce
> register pressure.
> 
> Once https://chromium-review.googlesource.com/c/angle/angle/+/3751106/1
> lands, I expect compilation will pass, but we'll still see runtime or
> compilation backend failure due to using too many local variables.

Pull request is merged but in ios it continue to crash
Comment 16 Kyle Piddington 2023-05-31 16:56:25 PDT
Hello!

I'm no longer seeing this reproduce and am able to use your configurator on iOS 16.4.1.(https://support.apple.com/en-us/HT213407).

If you're still seeing issues after updating, can you tell us more about your configuration, OS version, and specific issues?

Thanks!
Comment 17 Kimmo Kinnunen 2024-01-17 02:02:00 PST
Should be fixed now in shipping iOS versions