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
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.
The aforementioned fix hasn't worked for some user, though.
<rdar://problem/96800041>
I think this has been fixed now with https://bugs.chromium.org/p/angleproject/issues/detail?id=7487
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.
Thanks. Similar observations are being discussed in bug 237658 but it's not yet clear if these are related.
This should now work. If not, please reopen and attach a runnable reproduction if only possible.