Bug 242297 - Shader fails to link due to Metal internal error
Summary: Shader fails to link due to Metal internal error
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 237658
Blocks: anglemetalregr
  Show dependency treegraph
 
Reported: 2022-07-03 11:46 PDT by Pedro J. Estébanez
Modified: 2024-01-17 02:09 PST (History)
5 users (show)

See Also:


Attachments
Shader GLSL source code (18.64 KB, application/zip)
2022-07-03 11:46 PDT, Pedro J. Estébanez
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro J. Estébanez 2022-07-03 11:46:03 PDT
Created attachment 460642 [details]
Shader GLSL source code

A shader that the Godot game engine generates, which compiles and links succesfully on every other platform supporting OpenGL ES 3 or WebGL 2, on Safari running on an iPhone fails to be linked, and the following is logged: 
[Error] Internal error compiling shader with Metal backend.
[Error] Please submit this shader, or website as a bug to https://bugs.webkit.org
Comment 1 Pedro J. Estébanez 2022-07-03 13:19:18 PDT
I've been able to isolate the code line that causes the error:
float fog_far = fog_depth_end > 0.0 ? fog_depth_end : z_far;

If that line is replaced by the equivalent if-else construct, it works.
Comment 2 Pedro J. Estébanez 2022-07-04 01:50:06 PDT
The aforementioned fix hasn't worked for some user, though.
Comment 3 Radar WebKit Bug Importer 2022-07-10 11:47:16 PDT
<rdar://problem/96800041>
Comment 4 Kimmo Kinnunen 2022-08-01 00:20:03 PDT
I think this has been fixed now with
https://bugs.chromium.org/p/angleproject/issues/detail?id=7487
Comment 5 Pedro J. Estébanez 2022-08-01 01:18:46 PDT
Happy to know this is being addressed.

However, I wanted to stress that in my tests, even after replacing all the occurences of the ternary by their if-else equivalents, a new modality the issue happened: no errors reported neither at compile nor link, but the shader would still not render anything, as if there was a deeper internal issue that couldn't surface up to the user.
Comment 6 Kimmo Kinnunen 2022-08-01 03:51:22 PDT
Thanks. Similar observations are being discussed in bug 237658 but it's not yet clear if these are related.
Comment 7 Kimmo Kinnunen 2024-01-17 02:09:51 PST
This should now work. If not, please reopen and attach a runnable reproduction if only possible.