Hacker News new | ask | show | jobs
by atarian 906 days ago
Very interesting how similar the code for setting up the pipeline is similar to Metal.
2 comments

That’s not a coincidence.
Wasn’t the design of WebGPU heavily influenced be Metal?

Or was it that metal came from a team in Apple that helped work on WebGPU?

Apple and Mozilla presented WebGPU as basically a clone of Metal.

Then the standard changed a bit, but it was still based on modern GPU APIs

Isn’t it nice when standards just happen to come together. I like the similarities, it certainly helps when switching from one to the other.
"Helped" is one way to describe it. "Sat down and kicked their feet until they got their way" is another.
What were the better options at the time?
Or standards bodies exist in practice to push vendor solutions on others.

Apple plays that game well.

I think the story was that Apple refused to ship/implement Vulkan drivers for their computers, and everyone was scared of this happening again with WebGPU, so Apple got their way with the design of WebGPU.
I think everyone is in agreement that the Metal API is pretty nice and there was little objection to making the WebGPU API similar (unless portability concerns dictated otherwise). The main disagreement was over shaders.
Not really. Many wanted Vulkan for the web. But Apple virtually had a veto, apparently: https://cohost.org/mcc/post/1406157-i-want-to-talk-about-web...
Yes, really. There were other reservations about shader compilation in particular from other participants, Apple wasn't alone in that department (e.g. asset sizes and needing to fork the format to maintain compatibility guarantees). They did demand a non-binary format, which sealed the deal on no SPIR-V. But it was not as simple as "SPIR-V/Vulkan was perfect and what everyone except Apple wanted." The shading language by far had the most discussion and iterations; none of the participants in contrast had nearly as many reservations about the structure of the API.
It would be weird if everyone wanted the same thing, Vulkan or otherwise, but it seems quite clear that where Apple wanted something and some others did not, Apple got its way more often than not.