576 points · by mozumder · 9y ago · 625 comments
So Apple, the only company not supporting Vulkan on their platforms, is complaining that there isn't a cross-platform solution?
Things worth noting: - We believe other browser vendors agree with us that the web API should work on all three of the major native APIs. - The web has security requirements which force us to go a bit higher-level than Vulkan anyway.
I understand your desire to have Vulkan on Apple platforms, but it's really a separate issue from the right target for WebGPU.
No, it's not a separate issue.
If Apple supported Vulcan, the simple act of proposing this new API as a standard would be laughed out of the room.
We can only speculate why Apple won't support Vulcan but I'm going to go with "Prefer a solution they designed themselves over one designed by other parties".
Just support Vulkan and let's abandon this silliness, shall we?
In addition, even on platforms where there are unofficial Vulkan drivers (such as Windows), it's likely the natively available API will still have more complete support and better performance.
So either way, we need a cross-platform graphics API.
Let's focus this discussion on improving the web platform, not fighting battles about the underlying system APIs.
Yeah, support Vulkan.
There are no 'but's. Just support it and we can have simpler APIs on top of it.
Apple never listens to anyone, probably some higher exec wants better lock in and that they design the standards. Everyone else keep their mouths shut.
No, you're stating your own company's ambition.
The state of OpenGL will never improve: if you've followed Apple at any point over the last 25 years, it's pretty clear that they disengage very quickly from any technology that is starting to look deprecated/not the future. It works for hardware and software: first iMac with only USB and Ethernet, dropping the floppy drive, dropping CD/DVD drives, avoiding Blue-Ray entirely [1], only USB-C on last MacBook Pro, flash, etc. So my opinion is that OpenGL will never be developed further at Apple. They will probably drop all OpenGL support at some point in the next few years.
The other thing that is clear is that Apple doesn't like having their hands tied by third parties. The lack of adequate Kaby Lake processors for the launch of the last MacBook Pro, and the subsequent heat/hatred directed towards Apple because of it [2], is probably making quite a few people think that at some point they will really have to move the whole Mac line to Apple made ARM processors.
Apple started to ship a working Metal implementation to iOS developers before Vulkan was more than a draft [3]. This freedom to move at their own pace is worth a lot to Apple. Vulkan is a great piece of technology, but I don't have high hopes for it to be supported by Apple anytime soon.
[1] There were some licensing issues there, but had Apple thought the future of media consumption to be BR I'm sure they would have found a comprise. Instead they found an excuse to promote streaming / the Apple TV.
[2] Including on HN, where I would have thought the average reader to be a little bit more sophisticated on these technical matters.
[3] I don't have the exact timeline in head, so I might be wrong.
Edit: typo
The "lay of the land" is that the rest of the world is adopting Vulkan, and therefore the right target for WebGPU is very obviously Vulkan. Even macOS and iOS can (theoretically) support it thanks to MoltenVK [0], and Vulkan is already available on Windows. Trying to wrap all three "major" native APIs is pointless when there's already one that works everywhere and does so reasonably well.
It's yet more 'not invented here syndrome' from Apple.
Also, given that Windows versions other than ten still make up more than half of the PC market, Direct3D 12 is not even an option for most PCs, but Vulkan is.
So if we're being honest, it's not really "all three", but Apple vs. literally every other platform.
Obviously web applications can't simply be trusted not to crash an exposed driver, but "will result in a better API for the web." is exactly the opposite of what you would expect, given the history of high-level graphics APIs. Any layer of abstraction or heuristic other than those required for security reasons, will ultimately increase the number of implementation inconsistencies, that would be objectively worse.
Then consider just the shader language. It would be considerably easier and less error-prone to just support SPIR-V shader programs; but with this there will have to be even more levels of translation, even more places for things to go wrong, and a need to make completely new tooling to generate shader binaries.
Furthermore, driver bugs are a given, but Vulkan makes the skills to debug and report driver bugs portable across vendors and operating systems. If I'm an ISV and users are experiencing issues on Metal on OS X on an AMD card, I don't have layers, I largely don't know where to shim the library, and even if I could figure that out, why should I have to figure it out for every system?
Sony doesn't has official plans to ever doing it, as the PS4 APIs are better anyway.
Nintendo is only supporting Vulkan for easing bringing in titles to the Switch, because they actually have a better API called NVN that exposes all the graphics hardware features.
Considering that browsers implemented WebGL on top of DirectX, why would it be any different for a proposed new API?
In which case it's reasonable to at least have a discussion about what this new API might look like.
What hardware Nvidia and AMD will support with Vulkan? It might turn out, that they will support relatively new hardware and Windows 7 usually used with older hardware, so it might be unavailable even for Windows 7. And if those users will upgrade to Windows 10, they'll have working DirectX 12.
Some relevant quotes:
“It was a result of not having all the technological support we needed to make the game viable on Mac systems.” says Kaplan, referring to Apple’s policies with OSX. “We have a real love and dedication for Mac players, they’ve been extremely loyal to us and we love giving them Blizzard games.
“But when dealing with the PC, the Xbox One and the PS4 - all of which are extremely welcoming to the technological needs to run a next-generation shooter - in a lot of ways we felt left behind, that we weren’t given the support we needed to make a great product on the Mac.”
What part of that is "leverage to get their way"?
The post explicitly states that they don't expect the WebKit syntax to be the accepted syntax; it is merely one implementation that can help inform the discussions.
If you want to vent your rage about 3D graphics on the mac go file a radar.
This is the new normal, coinciding with the death of expertise.
The WebKit developers clearly are not working in a vacuum, if one bothers to read the blog post:
> Our proposal has been received positively by our colleagues at other browser engines, GPU vendors, and framework developers.
Not to mention that the WebKit developers are pretty much the forefathers of all modern web tech. So the WebKit developers and their colleagues are the experts. And the expert consensus is the successor to WebGL will be something new, something that can be implemented in DirectX 12+, Metal, and Vulkan.
But all the non-experts have heard of Vulkan, and are armed with the simplistic notion that Vulkan is the "next generation of OpenGL". They erroneously conclude that WebGL's successor must also be a Vulkan based solution.
The non-experts will justify this belief with all manner of ridiculous conspiracy-esque conclusions to reinforce their bias. Like "Apple is trying to force the standard", "Apple wasted their time developing Metal", "Apple is a closed-source walled garden", "Apple is expensive". All of which is is essentially the tech version of "libtard" based arguments.
RIP expertise.
IE4 was the forefather of modern web tech[1].
> They erroneously conclude that WebGL's successor must also be a Vulkan based solution. [...] All of which is is essentially the tech version of "libtard" based arguments.
No, people are sick of working against 3 different APIs. One of which is a standard. It's Microsoft doing their own thing with IE all over again. A safe subset of Vulkan would be familiar and would have existing documentation. All designed by GPU experts.
We did indeed discuss this widely. No one thought that an API which only works on top of Vulkan was right, everyone in the relevant sector thinks it has to support the big three. Very few thought modeling the API closely on Vulkan was the best technical path.
I honestly don't understand why everyone here is so obsessed with Vulkan. Cloning it on the web won't make it more successful in the market. Building a Web API that is able to work on top of it (without mandating it) will likely help Vulkan in the end.
1) It's currently the fastest (unlike DirectX)
2) It's not controlled by an OS company (unlike DirectX and Metal)
3) It reflects recent developer and hardware concerns (unlike OpenGL)
2) Apple is proposing an open standard here, they're not making WebMetal
3) Why do you think Apple's proposal doesn't?
I know a bit about DirectX and OpenGL, and I wouldn't expose a direct interface to either of them on the web. Does Vulcan make security and isolation assurances? If not then it is useless.
Though I do agree.
Apple decided to not support Vulkan as it had been developing a competing API called Metal at around the same time. I don't know why they don't also support Vulkan.
Metal is available since Jun 2014. Vulkan announced on 2015 and the initial release is on 2016.
> Meanwhile, GPU technology has improved and new software APIs have been created to better reflect the designs of modern GPUs. These new APIs exist at a lower level of abstraction and, due to their reduced overhead, generally offer better performance than OpenGL. The major platform technologies in this space are Direct3D 12 from Microsoft, Metal from Apple, and Vulkan from the Khronos Group. While these technologies have similar design concepts, unfortunately none are available across all platforms.
Oh, really? And who is to blame, that Vulkan is not available on Apple platforms?
I'm willing to give Apple the benefit of the doubt on this. Like any big tech organisation, I'm sure they have people who want to do the wrong thing, and people who want to do the right thing. Everyone supporting Vulcan would be nice, but a standardised, patent-free, cross-platform, web-enabled, low-level GPU API would still be a major step forward.
[1] https://gpuweb.github.io/admin/cg-charter.html [2] https://www.w3.org/community/about/agreements/cla/
So how come they didn't manage to have the same idea for touch events?
> Everyone supporting Vulcan would be nice, but a standardised, patent-free, cross-platform, web-enabled, low-level GPU API would still be a major step forward.
I'd say design and its roots matter. If they base it off Metal, and use Metal like technology, while Metal itself remains a closed Apple only API, then W3C should reject it. Consider the whole related ecosystem, like shaders and so on. Anything like that should be based on open APIs and related ecosystems, like WebGL is based on OpenGL.
If Apple want to help, let them base WebGPU on Vulkan. If not, they shouldn't waste everyone's time. I hope W3C participants will have enough common sense to come to the same conclusions.
I have no clue. You'd have to ask them. But they have had this idea for WebGPU. If you think it's better than what they did for touch events, let's hope you approach it with an open mind and-...
> I'd say design and its roots matter. If they base it off Metal, and use Metal like technology, while Metal itself remains a closed Apple only API, then W3C should reject it.
...No, you're just going to get mad about a hypothetical.
Literally the whole point of the WG is to design a low level GPU api specifically for the web with security etc in mind (i.e. not just "give javascript direct access to the GPU" like Google's WebUSB and WebBluetooth proposals) that can be backed by whatever GPU library is on the platform: for Window's that's DirectX (do you really want a web app to tell you that you need to update your GPU drivers to get support for Vulkan?), on (mac|tv|i|watchOS) that's Metal, on Linux its.. um.. Vulkan I guess or perhaps OpenGL or who knows what else people decide to install?
[1] https://www.g-truc.net/doc/OpenGL%20Drivers%20Status.pdf
When designing an API, you have to take the characteristics of the calling language into respect. Especially when you are trying to achieve the highest possible performance. You can define highlevel APIs, which try to minimize the amount of computation in the calling language, or a more lowlevel API, which gives only very basic operations, and the client has to implement more logic themselves.
When targeting "fast" languages like C/C++ you tend to design more lowlevel APIs, assuming that the client can implement abstractions more efficiently as they are more tuned to his needs. When targeting slower languages, you want to do more computation in the API.
So for designing a new Web API, you both have to consider that Javascript is slower than compiled C and on top of that, you have to consider security requirements. Your API should not create an attack vector to your device. This means, the best Web API would be an abstraction on top of the native low level API and the only question with respect to those would be: can the proposed API be implemented well and efficient on e.g. Vulcan?
off topic, but who is the client?
Is there a specific person you're talking about, or just a programmer in general? Does this have to be male, or are women also allowed to code?
I can only imagine the type of flack I'll get for raising this hear, but I find it difficult to parse sentences that are overly specific about a general collective of people. There's no need to mention gender here - consider using something like "they" instead.
Because I usually think, HN is different, from the angry, uninformed mobs out "on the streets".
I mean, I don't know much about low level graphic API's, I read about them, but I don't work with them directly. But apparently most of the people here don't know either!
They basically seem to know that they like open standards (so do I) and that Vulkan is a open Standard and they heard of a possible WebVulkan so that must be the solution then. Or just continue using WebGL. Because it works, right?
What they didn't heard of and what I came up with a bit of reading, before posting anything, is that WebVulkan first of all don't exist and secondly probably shouldn't exist mainly because of security. And that it is very, very low level. (e.g. https://floooh.github.io/2016/08/13/webgl-next.html) And that WebGL in itself has some flaws, so it makes sense to design a new API for the future, without them. Because even though WebGL is working and awesome right now, that's not a reason to not evolve ...
But why bother reading and really discuss a new WEB proposal, when "People just want Vulkan on MacOS and/or IOS."?
- Apple, particularly recently, have been terrible on supporting modern web proposals. Worse than anyone. Much worse than the typical historical reputational lower bar that is Microsoft.
- Apple's record on proposing new web standards has been demonstrably aggressively anti-open and not generally condusive to promoting interop https://www.w3.org/2012/te-pag/pagreport.html
- Apple's general record on cross-platform development is pretty much non-existent. To the contrary, much of their business decisions are specifically based on limiting interop with non-Apple platforms.
I think on a holistic level, if you take Apple's record into account at all, any criticisms from them of a cross-platform proposal of any kind need to be taken in context. Before you even start considering the pros and cons of Vulkan or WebVulkan, there's a very blatant case of cui bono to examine behind this.
Even if you do get past that, the points about commonality between native and web APIs are growing more and more relevant every day as Emscripten, WebAssembly and other such tech brings the two worlds closer to each other. Cross-compilation efforts will invariably be made easier with a more consistent API between (web and native) platforms.
Not really. Because yes, it is well known that Apple closes down their system and wants full controll over it and locks other partys out. One of the Reasons for me, to not buy them.
But what does this have to do, when they propose a new Web API? If Apple chooses to go a different way with metal (and a way apparently quite some devs like), than I don't see much point in trying to force them to go another way. Maybe metal is even superior - I can't judge that, but I am not going to say vulkan is superior, just because it is open(even though I would like it to be superior just for that fact). ButI don't see much point in dragging Web-Technologys into these discussion in the first place.
Especially since apparently it is possible to implement the proposed WebGPU on top of metal, vulkan or Direct3D !!
And even though "Cross-compilation efforts will invariably be made easier with a more consistent API between (web and native) platforms." is true , it is not gonna happen at the moment, since simply not everybody wants vulkan at the moment, but 2 major players stick with something else. And I am not sure it is only for power reasons, but maybe also for technical reasons, as I read from quite some devs, that working with vulcan is huge pain(and they prefer metal, if it would be open) .... as it is not made for working with it directly, but rather to be worked through a higher level API. So ... is there a different proposal for that higher level API than WebGPU to be discussed right now?
The web being inherently cross-platform in nature there's a motivation on their part to not support it, or - in this case - cripple it (perhaps to a mild degree but at least enough to render it categorically inferior to native metal and not worth the trade-offs). I can't say that their proposal does this necessarily, but there's inarguably a motivation to do so.
For a previous obvious example of this kind of thing, see the deliberate crippling of iOS UIWebView.
> I am not sure it is only for power reasons, but maybe also for technical reasons
Call me a cynic, but while there may be good, valid technical arguments against Vulkan, it's mainly for power reasons.
"What a WebGL2 successor could look like and why it can’t be WebVulkan" - https://floooh.github.io/2016/08/13/webgl-next.html
See also the the author's sketch of a next-gen web graphics API on top of WebGL (https://floooh.github.io/2016/10/24/altai.html) which is (perhaps unsurprisingl) broadly similar to the sketch given the article (minus command queues, shader libraries, ...).
They haven't even made a public statement.
And now we get the news that they are working on another API. It doesn't really matter that the new API is targeting a completely different market to Vulkan. It doesn't really matter that a WebVulkan can't really exist in the first place. It doesn't matter if this is probally the correct starting point for a NextGen web graphics API.
It doesn't even matter that the team at apple proposing this API is not the same team that would be responsible implementing Vulkan in OSX.
People just want Vulkan on MacOS and/or IOS.
The Apple employees posting in here posting some really interesting stuff, but it's all being drowned out by this noise that has little to do with the topic at hand.
Scads of this thread are giving me that signal loud and clear. Not HN at it's best.
Vulkan is great, but you need to think about the cross compatibility of the web.
If Vulkan took this long to adopt partially, how long do you think a new 3D + Web standard will actually take? My money's in 10 years.
Mind you, it does at least look like they're trying not to be jerks about it (even if the motivation is somewhat selfish). They specifically mention the competition to Metal and how "webgpu" is ideally an abstraction that'll sit on-top of Vulkan, Metal and Direct3D 12.
It'll be interesting to see how this pans out. Vulkan, Metal and Direct3D 12 are all intentionally very low level, adding a wrapper of any kind may be seen as non-ideal by all parties.
We've discussed our proposal a lot with key players in this space (including other browsers, GPU vendors, relevant ISVs) and we're pretty sure a cross-API abstraction is the way to go.
Some even want to build a form of cross-API abstraction at the native C/C++ level.
The end goal is to maintain Metal as a proprietary bit of tech for native apps, in order to make it more burdensome for people to port native apps away from the Apple platform and as a result give Apple more exclusive apps and more artificial barriers to entry for competitors. Why should the web standards people be bending backwards to support that goal?
> Working on top of all the major APIs is the right thing for the web.
A standard is the right thing for the web. Whether that's an abstraction or agreement upon an existing implementation remains to be seen.
No, the right thing for the broader ecosystem is working only on Vulkan, and forcing Apple to adopt Vulkan, so that one API is usable natively on every OS, device (even Nintendo will support Vulkan on its consoles!) and browser.
If Apple wants to go their own way, sure, but they’ll be cut off from the rest of the world, and quickly realize where they went wrong.
It is a joke to suggest putting another abstraction over the low-level api. That is squarely the domain of libraries and frameworks.
That's fine for native apps when the libraries and frameworks can be native and thus high performance but, on the web, these have to compile to JavaScript and, while that can be very fast, a native framework is going to be faster than one running in JavaScript ontop of a lower-level API. This is a problem with the web though.
They only care about standards when they're basically forced to adopt/support them, or they're their own.
These are the same guys that:
- use lightning instead of mini USB
- removed the headphone jack
- are creating yet another proprietary connector for accessories
- don't allow their OS on third-party hardware
- only allow developing for iOS from macOS
- only allow apps on iOS if you install from the App Store
- only allow their own browser engine on iOS
- etc.
Everyone wants their own standard to be the standard, if they really cared about it they would contribute to Vulkan and create WebVulkan.
“It seems many people are missing the point of this. 3rd party cable makers want to make certified cables that are Lightning to UAC port so people can plug in iPhones and iPads into cameras that use these ports. Apple isn't wanting to use this port, it is the cable manufacturers wanting to make adapter cables to plug more things into iPhones and iPads.”
[1] https://arstechnica.com/apple/2017/02/no-apple-isnt-developi...
mini usb? http://phandroid.s3.amazonaws.com/wp-content/uploads/2009/06... I'm assuming you mean USB-C, which was developed after Lightning with a push from Apple (they contributed more engineers to the USB-C spec team than any consumer electronic company).
Where are getUserMedia, MediaRecorder, WebRTC, filesystem, vibration, screen orientation, Service Workers, Web Bluetooth ? What about WebGL 2? I'm sure there are a few more I missed too.
Those are things that are really holding the web browsing experience back on iOS/MacOS, not an extra 20% 3D performance and slightly shinier graphics.
Or why not lift the app store restrictions so that Google/Mozilla can actually ship non-crippled web browsers and implement it all for you?
The sudden interest in a web graphics api is somewhat conspicuous coming from a company known not to adhere to web standards.
There must be some reason for apples sudden interest in this stuff. Knowing apple they're interest probably isn't aligned with their users interest.
As someone who spends a lot of time in that space I don't really see what this is solving, WebGL is good enough and anyone serious about performance/compute are going to drop down to native anyway.
Not true at all; if your primary performance bottleneck is the GPU code, not CPU code, you could use a better web API modeled after Vulkan, for the same reason people switch from GL to Vulkan.
In general, if there's ever something where people feel they "have to" use native instead of web, that needs fixing in the web platform.
Another aspect that scares me about this is the security implications of exposing compute to the browser. Esp when you start talking about unified memory architectures. There's been more than a few exploits from a clever soul calling glReadPixels in the right circumstances. Increasing the surface area here doesn't seem like a great idea. Shader compilers are also great targets for instability and obscure bugs.
Memory bandwidth for your textures, geometry, and other data, quite often. Or nothing at all, if you can successfully reach your desired target framerate.
But if CPU turns out to be an issue, that's what WebAssembly is for.
Problem is you cannot get anything close to that on any reasonable sampling of OpenGL platforms, in anything close to working condition. At best you just end up using the degenerate subset of APIs that can actually work across all your targeted systems - for a fully cross-platform title, that would include Android, and probably limit you to OpenGL ES 2. If you drop mobile, it would be around OpenGL 3.1-3.3. If you throw out some hardware as new as 2012, you could get stuck at Apple's last supported (which is buggy and broken all the same) OpenGL at 4.1. You can throw out Apple, and get stuck at recent Windows AMD and Intel support around 4.2.
But that is the best case - where you don't then pick your target and find out all the drivers are broken in a dozen different ways each for the extensions you are using.
It is only OpenGL 4.4 and 4.5 that Khronos has required conformance testing for certification for, and very few people are targeting those for development because of how limited a subset of the market actually supports them.
So that is the point where you throw the whole mess out and just use Vulkan - which only has one major release version, and has 3 feature support levels you can pick from, with conformance testing for all of them.
As someone who also spends a lot of time in the GPU space, I really want something newer than WebGL. WebGL is not good enough.
FWIW there's tons of things build on OpenGL ES 2(all of Android for instance). If you're going to write something to run on a wide range of platforms you're either going to deal with least-common denominator(GLES2) or write per-platform layers(like we'd do on consoles/etc).
You say that like it's a good thing! The point of WebGL is to put that pain on the browser vendor.
OpenGL ES 2 is incredibly limited, as you know. Yeah, you can do a lot with it, but there's a ton of stuff you can't do (tessellation, compute, image load/store, heck, even unbounded loops in shaders). Why should the Web be limited to that?
In the extreme case you get stuff like "GPU-Driven Rendering Pipelines" described in http://advances.realtimerendering.com/s2015/
- Implementing OpenGL drivers is very complicated, this leads to huge drivers full of bugs and performance issues. Just look at something like this: https://dolphin-emu.org/blog/2013/09/26/dolphin-emulator-and...
- OpenGL's state machine logic is outdated and horrible to debug. We need something more modern. Basically its carrying cruft from the last ~20 years.
- It can be very slow compared to Vulkan/Metal/DX 12.
- It doesnt allow modern features like GPGPU. this would allow is to truely use the GPU for computing stuff (e.g. AI, novel shaders, new graphics pipelines etc.)
A good graphics API, even a web one, is one that provides good control over the GPU.. and to have sane standards which limit future implementation fragmentation (like shader byte-code instead of a specific shader language), and to have good debugging tools, etc.. That's what Vulkan is, regardless of how verbose it is in comparison to OpenGL.
I'm not saying you can just make Vulkan run on the web, but I'm certainly in favor of a Vulkan-subset (using SPIR-V as a shader base) becoming the successor to WebGL over one inspired by Metal and MSL.
As someone else noted, Apple created OpenCL, helped make it a standard and dumped it. It embraced OpenGL when Mac OS X first came out and now it can't be bothered to implement anything beyond 4.1. All of these little irritations serve to remind people of the Apple of yore that had NIH in extremis and was the gang that couldn't shoot straight.
The hostility is unfortunate, but I fear it's going to become more frequent if Apple's senior management thinks the ship is fine.
Moreover, web standards last much longer than typical desktop APIs. Do we really want to take a snapshot of Vulkan's API today and live with it on the web for the next couple decades, as desktop Vulkan continues to evolve?
It's better to build a web API that is fluent for its target platform, taking care that it's possible to implement it performantly on foreseeable host platforms.
Let Apple lock themselves in if they want. Don't lock the web into Vulkan.
This doesn't even touch the reasons it hasn't been, and the most important of these for me is security. "Well yes, it's extremely low level and admittedly very dangerous, but we can make it secure enough to expose to the most hostile environment in the history of computing" is how we ended up in the mess we are in right now security wise. You want a secure system, you have to build it that way from the start preferably in languages that don't let you decapitate yourself like Rust. I'm pretty sure it's a consensus that it's impossible to write secure C code these days, so why is everyone so convinced we could sufficiently harden a low level graphics API for web use? This is like if when NetScape proposed JavaScript if everyone went "well you're just trying to dominate it, we already have C89 just put that in the browser." Fucking NO. When are we as an industry and a discipline going to learn our lesson with this "code first, secure later" crap?
And again, if this could be done and it's such a great idea, why is this the first proposal and not actual WebVulkan? The argument here is not WebVulkan vs WebGPU because again WebVulkan does not fucking exist. When or if it does, perhaps we can argue about why Apple won't support it if they don't, but until then, you're shooting down one attempt at a standard API with a hypothetical thing that does not exist and which a lot of experts in the field seem to think is a bad idea from several angles.
I will reiterate this one last time because it seems like everyone has missed this: there is currently no cross-platform solution for next-gen web graphics except for this proposal. Put up or shut up.
How convenient to propose your own standard as the standard, made specifically for your own engine...
Yes, they're using the Metal Shading Language in this initial proposal. But in the blog post they explicitly say that the choice of the shading language is likely to be contentious (or, as they put it, "fun"), and so they're deferring the issue right now and just picking the Metal Shading Language because they're Apple developers. The actual choice of shading language in the final version of this proposal is going to be the result of the standardization process, and will probably not end up being the Metal Shading Language.
I would like to have such simplicity in a potential language that when I see a scene in my minds' eye, it's really easy to transfer to the digital realm. I think the simplicity of representation is key.
Being a web dev on my own hours for the past several years now has given me a pretty solid grip of all the needs of an interactive application, and I can say that there has to be some way for users to easily interact and offer all the possible inlets for the information. Starting a 3D-internet movement might require rethinking the inputs. Won't we just use holo-wands to navigate vast swathes of data rapidly? Run through this field of data sheets...
So yeah, rethinking the medium will naturally come up as a question in conversations around this, and I think that it's simply a matter of keeping "user input" as straightforward and easy as possible, in the local _and_ distributed sense. With that as a foundational block, the rest of the 3D scene can start to make sense.
From a dev perspective my thinking is this. If I were to learn a 3D graphics API for the web I'd like that knowledge to be transferable to native development as well. An API built on Vulcan - even if abstracted - would be more pertinent and more compatible with existing tools than one built on Metal.
I'll be curious to see comments from other committee members as they'd have more insight on the subject.
It is a common observation among game developers who have really tried both that Metal is a much more accessible API than Vulkan; "90% of the performance for 10% of the effort".
Any citation on the matter?
But see this: https://twitter.com/aras_p/status/749546349474054144 https://twitter.com/aras_p/status/767740566792724480
and this:
http://zeuxcg.org/2016/12/01/metal-retrospective/
and this:
I can see two views here. Firstly, that as the open standard, Vulkan should have a privileged position and be supported from the Web side, to make the Vulkan -> Web -> Native abstraction layer standard, small and efficient. As a developer you would just implement the necessary algorithms for your application once, using Vulkan.
The alternative view is that Vulkan is just too low level and doesn't fit in the web security model. Then, the purpose of WebGPU is not to implement Vulkan in Javascript. Instead, it's another target in addition to the existing three: Apple, Microsoft, Kronos, and web. To get maximum performance, developers must write an application-specific, high level platform abstraction layer, and implement that interface for each supported platform.
It seems to me that this article is of the latter view, especially as it doesn't put Metal in a strategically weaker position than Vulkan.
If you don't need state of the art or original rendering techniques and algorithms, I think there is already a high level abstraction which is compatible with the web: OpenGL ES 2, and soon OpenGL ES 3. (WebGL & WebGL 2).
It's a very different situation to macOS, where Apple are the sole gatekeepers of the graphics stack and nothing can ever happen without their direct support.
Considering the lengthy turn-around time for these APIs (WebGL 2.0 took four years to get from a draft spec to enabled in some browsers by default), any Windows machine that couldn't run WebVulkan would be rather long in the tooth by the time the standard sees any real world use.
The current Plan Of Record is that Intel® is not supporting Vulkan on Windows drivers. The drivers that were made available on Developer.com are intended for Vulkan developers.
So, it is expected that some Vulkan drivers may not work for end users.
https://communities.intel.com/thread/104380?start=30&tstart=...
https://software.intel.com/en-us/forums/developing-games-and...
Disclaimer: haven't read the new Apple web 3D spec, just curious about others' opinions.
We expect threadsafety, memory safety, data validation, and memory protection for the shader language to be the big issues.
1. What is the (proposed) backward compatibility across devices?
2.Given that it is structured for Metal shaders, what are the plans for other, non-apple devices? I see the hat tip to D3D and Vulkan, but I assume they need to get on board first - any early takers? After all common standard means cross-platform hardware support, something Apple has never really embraced.
Also, Metal was announced June 2014, released September 2014. Vulkan was announced March 2015, released Feb 2016.
I don't see any reason for favoring Vulkan specifically for Web when compared to Metal I can read: "Metal still does a lot of hand holding and behind-the-scenes management for you, while with Vulkan you are responsible for — literally — everything. And man they were NOT kidding when they said that the API is explicit. Its actually quite ridiculous how difficult and detailed the API is." (1)
It was rebranded then, but OpenGL Next was announced in August 2014.
http://www.anandtech.com/show/8363/khronos-announces-next-ge...
But to the people saying use Vulkan for the web API, that wouldn't be a good idea. Vulkan is a very verbose low level API.
Here[1] is a sample for the most basic of renderers (renders a single triangle). That's 1,000 lines of (commented) code. It's not a good fit for web development. A far better solution would be to evolve the current WebGL API, than shoehorn Vulkan into somewhere it was never meant to be.
[1] https://github.com/SaschaWillems/Vulkan/blob/master/triangle...
(edit: I realized this API is mostly designed 1:1 with the Metal API, so the docs for that API have filled in most of the missing pieces)
In general, Vulkan was not designed with the web in mind. For example: Vulkan's design intentionally has a whole lot of undefined behavior. Instead of strictly specifying what happens in all possible accidental cases, they strictly specify what is defined and provide debug layers that help you identify during development when you are unknowingly stepping into bizarro land.
Also, I expect Vulkan was designed with the expectation of process-level isolation being the end-all of security concerns. That's not sufficient for single-process, multi-tab browsers.
Chrome has process isolation, and Firefox is developing process isolation right now. I don't think it makes sense for a new technology stack to go out of its way to support single-process multi-tab browsers.
It does allow you to create pipeline state objects ahead of time like Vulkan and D3D12 but they only include a subset of state (shader + antialiasing state + color/depth attachment state). The rest of the state is set when recording the command buffer.
On the other hand all the big engines already support multiple backends so adding another for yet another API is probably not a problem
As a WebGL replacement and as a 3D API in general, many details of the proposal are strange.
>Since we were building on Apple platforms we picked the Metal Shading Language.
Mature and portable technology...
>pipelineDescriptor.colorAttachments[0].pixelFormat = "BGRA8Unorm";
No enumerations? Are they going to validate strings?
>let vertexData = new Float32Array([ /* some data */ ]); >let vertexBuffer = gpu.createBuffer(vertexData); >commandEncoder.setVertexBuffer(vertexBuffer, 0, 0);
No internal structure?
>commandEncoder.drawPrimitives("triangle", 0, 3);
One triangle? No index buffers?
I don't understand whether they are offering an insultingly dumbed down overview of a rather complete (but presumably ugly) proof of concept implementation or throwing around gratuitously WebGL-incompatible ideas to dominate the standardization process.
The string thing is the way enums tend to be done in modern JS APIs. It's not really a bottleneck but if it turned out to be, we'd go a different way.
That said, from what I read of the proposal there were some interesting and useful ideas. So take those ideas and start going to the meetings to build consensus with the open standards instead of trying to co-opt it (which is how this comes off).
In addition, Apple might want to consider getting WebKit in line with the existing web standards before throwing curve balls. Currently lagging way behind in many areas, which means we have to do much more work for Webkit based browsers than anything from Mozilla, Microsoft or Google, and support for some features isn't even possible.
Don't mean to be a Debbie Downer, and I'm sure the team itself has good intentions, but come on.. Like everyone says the last thing the world needs right now is yet another proposal for a modern Web 3D. It will reset the clock. Again!
Re: iOS being popular; You're in a bubble, the iOS market share as of 2016Q3 is 12.5%.
As for market share, that's percent of devices sold. By web browsing it's about 25%, and that doesn't include the possibly outsized influence it has due to being so much more common at the top of the market.
I mean if we're only paying attention to desktops than this whole discussion is moot. Safari on the desktop has a pathetically small market share, Chrome and various versions of IE easily dominat it. There's no reason to think that even if we ended up with the equivalent of WebMetal that would seriously boost desktop Safari's market share.
iOS, especially given the rules around alternate browsers, is the reason this discussion is important at all. Those hundreds of millions of devices or where this may matter.
Porting an app from OpenGL to Metal is much easier than porting to Vulkan. A naive port to Metal often performs better than the GL version, whereas getting performance out of a Vulkan port is a lot harder [1]. So, I really hope the proposed API will be a C-based API that can also serve as a middle layer on top of Vulkan/D3D12 for lesser mortals like me in writing cross-platform native apps.
[1] aras-p is a Unity dev: https://twitter.com/aras_p/status/628569113053528065 and https://twitter.com/aras_p/status/628569238794543104
Obviously Safari wouldn't matter if Apple allowed other browsers on iOS, but no, they insist on dragging the whole Internet a few years behind.
I recommend supporting ffv1 or HEVC Still Profile (where patents don't apply).
Which works only on one size of screen? :)
Otherwise it's just an incompatible wart like the getUserMedia implementation was for years, like webaudio still is, and like some of their latest hardware ideas have been.
Polyfill first, engine bloat later
Note that on desktop, OpenCL is dead for NVIDIA too (they've been stuck on 1.2 for ages, they removed their profiler, ...), and AMD's new stuff also dropped OpenCL 2.0 support.
I like OpenCL but it doesn't look like it's going anywhere. The unified compute+graphics APIs are king.
https://jakearchibald.github.io/isserviceworkerready/
Safari is intentionally crippled in several areas. Its very specific and obvious. It is dishonest for you to at this point pretend Apple is going full force for web standards while they are explicitly not implementing features that are available everywhere else. And how those specific features line up directly as features which allow web apps to compete with its native application market.
Edit: To anyone seeing this down-voted. Apple employees typically down-vote stuff like this so please do not take this being greyed as anything but manufactured opinion.
We detached this subthread from https://news.ycombinator.com/item?id=13593606 and marked it off-topic.
In terms of tracked features they're ahead of Edge with both their stable release and in development (TP) builds.
Don't let your own prejudices distort reality.
Every. single. other. browser. Including desktop Safari.
http://caniuse.com/#feat=es6-module
Like I said, "ahead of the game in a lot of areas", not every area.
I hate websites trying to give me notifications. I like that I don't get stupid prompts from mobile Safari about that kind of thing.
IE: Not Supported
Opera Mini: Not Supported
Chrome for Android: Not Supported
We need concise, clear and coherent code.
Currently, it's not possible to access a user's microphone or webcam in Safari (desktop and iOS). They're the major outlier when compared to other browser vendors: http://caniuse.com/#search=getusermedia
Vulkan isn't available on the Mac huh? Yeah Apple, and just who's fault is that??
We have seen this before - fortunately no matter how much money they put behind this bad idea, the internet is larger than apple, and open standard apis and choice will eventually win.
I don't want an apple api, I don't want yet-another-kool-language-fad they will drop in the next marketing cycle, I want old style javascript to run fast and be standards compliant on mobile, including on iOS devices.