Just because it was designed to be high-performance doesn't mean it automatically wins on platform support and implementation quality. Direct3D 12 is at the same level as Vulkan, and I see no reason for the trend of D3D being higher quality than GL to end with Vulkan.
Although you and those you've been discussing this with can't agree on which API is better, there's plenty of evidence that Vulcan, Metal and Dx are all quite good. Why then would we introduce yet another "standard" from scratch, as opposed to working to implement one of the existing ones better across platforms (if the desire is truly to build a universal gfx api)?
Even if the web platform directly replicated one of the existing APIs, you still have to explain how it binds to JavaScript, as well as memory and GPU resource management details. So bringing a modern graphics API to the web will inevitably create a new standard.
The question then is whether to try to clone one of the native-level APIs, or make something that works on each of the top 3. We think working on all of them is better than tying ourselves to just one.
Besides this approach being supportive of lock-in (of underlying closed APIs like Metal and DX), which is more than questionable, more importantly, what shading language should this Web API use for example?
Worth noting also that Khronos is considering a slightly higher-level API than Vulkan as their next iteration. So that's another reason it would be a shame to bind too tightly to Vulkan.
I also find it puzzling how designing to support multiple back ends is "lock-in" but binding tightly to only one underlying API is "open".
Lock-in refers to how that platform affects your options for deployment.
Openness refers to how that platform is being developed.
A platform can be designed in an open way, but if it only works in one environment (e.g. browser) you might consider that to be "locked in". As in, you are "locked" into using a browser for deploying your application.
Vulkan is open, in the sense that it is an open standard. It's managed in a way that allows a wide variety of people/companies to contribute to it's design and implementation.
Vulkan as an API is an abstract model for how a GPU works. Everyone codes to that spec, and they can work on a wide variety of systems. So you are not locked in to a limited set of systems.
In fact, if you wanted to make your own Vulkan implementation you could, and there is a lot of documentation, conformance tests, etc to help with that.
Supporting multiple backends naturally requires an abstract API on top to handle the inconsistencies in the underlying systems. A new API naturally means that existing code would need to be refactored to work with it. If that API only serves the purpose of executing within a specific context, you might consider that to be "lock-in" for that platform.
Maybe that will change, but blocking on a major new WebAssembly feature did not seem wise.
DX12: Windows only. Metal: macOS/iOS only. Vulkan: cross-platform and cross-vendor. Windows 7/8/10, Android, Linux, MoltenVK supports iOS/macOS with a wrapper. That's a big win for Vulkan IMHO. Valve also agrees with this assertion.
In terms of performance, I don't think Metal is even a contender, given how bad macOS hardware is compared to Wintel. w.r.t. Vulkan vs DX, from what I've seen it's pretty close, with Vulkan usually coming out ahead by a few performance points but of course it depends a lot on the implementation when it's at that level. Vulkan has been shown to be systematically better than OpenGL.
In addition, Apple will be rightly considering iOS when evaluating options for web technologies, not the increasingly small section of the planet running Nvidia and AMD hardware on Windows.
I didn't make any such judgement or even mention VR a single time!
But, looking at the points you've raised, I can say with confidence that Vulkan has been designed, taking into considering these issues.
Vulkan has been carefully engineered from the ground up not to alienate tile-based renderer hardware. So, it's just as suitable for mobile GPUs as desktop GPUs. https://www.imgtec.com/blog/tiling-positive-or-how-vulkan-ma...
As such, it's already supported by many mobile GPU hardware vendors.
> In addition, Apple will be rightly considering iOS when evaluating options for web technologies, not the increasingly small section of the planet running Nvidia and AMD hardware on Windows.
The GPU in the iPhone 7 uses a custom version of the PowerVR GT7600 GPU. While this is purely speculation, PowerVR does support Vulkan in their other offerings, so it's not that much of a stretch to assume that the hardware is at least capable of it.
NVidia, AMD and Intel power all of Apple's desktop graphics, in addition, they collectively power almost all of Windows and Linux setups too (excepting other mobile and SFF computers)
> In terms of performance, I don't think Metal is even a contender, given how bad macOS hardware is compared to Wintel.
> In terms of performance, I don't think Metal is even a contender, given how bad macOS hardware is compared to Wintel.
The response was:
> It makes no sense to judge the quality of an API by the power of the available hardware it might be running on.
You are right, that my statement is not very clear.
The key point here is that I'm not judging the quality of an API by the power of the available hardware, but the quality of APIs relative to how much overhead they add, and that's quite a different proposition.
Given my intimate frustration with the state of Mac hardware and GPUs, I brushed off macOS as being somewhat ancient w.r.t. modern hardware and benchmarks. You can't go out and buy a Mac with a GTX 1080 for example. In fact, even the best Mac hardware you can buy is ridiculously outclassed by PCs costing significantly less.
However, back to the specific point of interest:
The overhead of APIs can be measured if you run the same benchmark, on the same hardware, with the different API. On Windows, it's possible to compare, say, DX9, DX11, DX12, OpenGL and Vulkan within the same benchmark. It's not possible to test Metal this way.
Specifically though, Vulkan is a C based API which is essentially as fast as it gets, in terms of actual function calls and so on. In comparison, Metal uses Objective-C. If you are familiar with Objective-C, you'll know that it doesn't have the fastest message dispatch (quasi-function call).
Basically, it would be really interesting to compare them, holding all other things equal. But, doing this with off the shelf GPUs simply isn't possible AFAIK. macOS hardware is simply too far behind. You might be able to jury-rig something using an external GPU, but it's still not a good comparison. My past experience of the graphics stack in macOS tells me it's unlikely to be great.
Also you seem to be under the impression that because a machine is expensive it is destined for gaming.
Without investing a lot of effort, the best I have is this: http://www.codeotaku.com/journal/2009-05/run-time-polymorphi...
In addition, my entire lament is that it's not easy to compare Metal to anything else. Ideally, this would tell you whether function dispatch was REALLY a big issue or not.
> Also you seem to be under the impression that because a machine is expensive it is destined for gaming.
No, that's not a valid assessment of my position.
I have an expensive desktop, and I use it primarily for work. Even the Mac Pro performs poorly when compared to an equivalently priced PC. Even just for work related scenarios. Some good comparisons on YouTube :D
Many times bottlenecks and missteps are not really visible until you can see how your decisions and assumptions encounter reality especially when every other chokepoiht has been removed.
Unless they did their development on Windows or on hardware that has never shipped, Apple isn't really in the position to have evaluated how well Metal works in reality.
I would add that the awkwardness of some "good" API designs is often not revealed until much later (and this is doubly true in the graphics space where there is ample evidence of API choices revealing themselves to be stuck with what turned out to be bad choices some times later).
As for past driver quality, ask a graphics developer doing anything more complicated than a toy weekend project. OpenGL drivers are inconsistent and buggy.
I never asserted that. I didn't even qualify what I meant by "BEST". But, let's evaluate the qualities you mention:
> platform support
Vulkan objectively wins here, supporting Windows 7/8/10, Linux, macOS/iOS with a wrapper, Android, etc. Intel has unofficial drivers for their x86 iGPU. Qualcomm recently announced hardware support, along with ARM.
> implementation quality
Vulkan is developed as an open specification, and has a full conformance test for implementations (https://www.khronos.org/vulkan/adopters/). Many aspects of Vulkan are available on GitHub and you can submit PRs. In my experience, drivers on Linux are very good and there are frequent updates. We currently deploy Vulkan at scale in production and haven't had a single issue with reliability.
In addition, the Vulkan validation layers assist with development because they check almost all API invariants and log incorrect usage. This helps to develop programs that work correctly according to the specs.
So, from the driver stack to the client software, Vulkan, IMHO, has a quality and well thought out implementation.
In comparison to DX12, which is developed behind closed doors, we don't know the implementation quality.
I personally haven't heard about any major bugs in Vulkan drivers, but I have seen quite few DX12 demos plagued by bugs. That's my subjective opinion though.
> Direct3D 12 is at the same level as Vulkan
Vulkan is better than DX12 in terms of openness, conformance testing, development tools, platform support, etc. Performance is about the same.
Even Valve agrees: http://www.kitguru.net/components/graphic-cards/anton-shilov...
> OpenGL drivers are inconsistent and buggy.
Agreed :)
We absolutely know the implementation quality of D3D- you don't have to see the source to see its performance, its stability, or its adherence to the spec. On the whole, it's far more consistent and stable than OpenGL and there is no reason to believe Vulkan will change any of that as it uses the same process for specification, development, and deployment.
Especially since things like NaCl exist(ed) which are inarguably lower level and still safe.
I think it's folly to create a whole new API before evaluating the option of using Vulkan.
If you are very interested in the details of API design choices, then I'd suggest joining the Community Group. Anyone can join!
Besides, Javascript doesn't really need driver support to intercept function calls...
> if you're allowed to change the API instead of just inserting checks at each call.
The only case is where you simply make the API so limited that it becomes decidable, e.g. remove all backwards flow control and recursion.
> Besides, Javascript doesn't really need driver support to intercept function calls...
Nope, it doesn't, but it makes for a more flexible approach when there is an existing model and implementation (validation layer) which supports this approach.
Improving the quality of the validation layer means that everyone benefits. It's also a massive job and thus, that something already exists, and is standardised, is a good approach.
Undecidable control flow does not inherently make validation undecidable, or NP, or anything else really. The key (like with any sort of type system) is that it's okay to reject some subset of valid programs in exchange for easy enforcement of the invariants you need.
In addition to my other points, the Vulkan validation layers are objectively (and IMHO significantly) better for debugging than OpenGL ever was. It's not just to improve performance. The debugging and development experience is significantly improved.
This seems to have worked out pretty well for innovation in the mobile OS market, no?
As a consumer, the mobile device market is a walled garden. Are apps compatible between platforms? Do you have control over your hardware? Can you choose what software you run on your own device?
That would be an awful experience for the consumers, UI/UX-wise.
Web is convenient in the sense that its easy to get access to a lot of applications and you don't have to install them etc, but the UX often leaves a lot to be desired...
As I value user experience and performance above all, for personal projects I prefer to focus on a single platform. And so far, I was also always more happy when using applications from developers that do the same.
On the plus side platform exclusives almost totally gone outside of the game is manufactured by the console makers themselves.
But that number doesn't seem to be high enough to cause serious sales dips on iOS devices.
I'm not saying the number is 100% of consumers don't care. But it's also pretty clear it's not 70% who do care.
Say something like "Apple is still successful despite the lack of freedom" :)
Do you really not see the parallels? It seemed like a really great way to point out the fallacy here and demonstrate that "just because people aren't complaining, and even if when asked they are adamant they don't have a problem (an even stronger position than simply that they aren't going out of their way to complain), it clearly doesn't imply they don't have a problem if they haven't been given the necessary knowledge to understand or appreciate the problem" without having to directly engage with the broken logic (which is, of course, impossible).
>However, in a meta-study spanning 40,473 males, the studies rated most accurate found that "circumcision had no overall adverse effect on penile sensitivity, sexual arousal, sexual sensation, erectile function, premature ejaculation, ejaculatory latency, orgasm difficulties, sexual satisfaction, pleasure, or pain during penetration."
Therefore your posts are off-topic.
The driver API exposes a layered stack. It's trivial to add a validation layer between the driver and the client. It's SO much better than existing OpenGL or DirectX driver models for this one reason alone.
I think Metal has a better API. You are free to disagree of course.
> I think you are wrong on that. Vulkan is a low-level native API, not a JavaScript API for the web. Lots of design work needs to be done.
Nothing you assert here is invalid. But, I think you've missed the main point, which is that people don't want an entirely new API, they want the same API across all platforms. Vulkan, exposed directly in JavaScript as much as is feasible (e.g. using an automatic API generation tool) would be awesome.
Simply look at how it is possible to cross-compile C/C++ to JavaScript. Now, add in support the Vulkan API. That would be incredible.
> 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.
Actually that's not correct. Vulkan was explicitly designed to be an efficient and high-performance API. As it stands, even as a newborn API, it's the BEST available for 3D rendering on all platforms that support it, unofficial or not.
> 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.
I think you are missing the point here again. As you say, we need a cross-platform API. But, by that logic, accepting that JavaScript is just another platform, we'd like the SAME API.