Vulkan is coming to macOS and iOS, but no thanks to Apple
arstechnica.com
arstechnica.com
Such a shame that such essential support for hardware that comes with every Mac apparently needs to be provided by a third party.
From Apple's perspective it's probably worth a try to get lock-in! Their real leverage is iOS, which lots of games want to target.
I do agree that this time it might be different. There's no great cross-platform open-spec solution for, say, EventKit, so when Apple offers up their own API, we've just gone with it. Game Developers are a huge existing community, in a way that Calendar Developers are not. Metal and Vulkan are an unstoppable force meeting an immovable object.
As someone who learned to program in the 1980's, it's pretty amazing that it's getting feasible to target high-performance graphics on every major platform from a single code base. Targeting every user in the world using only 2 graphics libraries doesn't seem so terrible to me. Consider how different the "Lemmings" source code must have been for Commodore Amiga versus the Commodore C=64, for example, not to mention the other 25 platforms it was ported to.
Maybe in absolute terms, but relatively speaking these things could not exist and nothing would change. They are /exceptionally niche/ libraries at best .. non-existent if honest
Metal has no such argument, to the best of my knowledge.
Vulkan is the typical Khronos API, pure C, has the extension dance to find out what is available, just knows about pixels and for everything else everyone needs to go fishing for libraries.
They probably figure, if developers are willing to do it for DirectX, they'll be willing to do it for Metal also / instead.
But AAA on a Windows desktop commands $40-60, whereas AAA on mobile commands < $8 +/- scuzzy IAP schemes.
This list[1] is quite a bit different looking from this list[2]
iPhone sales in 2017 were 223 million (https://www.usatoday.com/story/tech/talkingtech/2017/12/29/i...)
The total market share is a much more complicated picture, obviously, but I don't think the difference is nearly as big as you do.
In any case, that still puts Metal and DirectX in the same order of magnitude.
And you’re right - a look at the developer docs for Metal do show that ‘this matters’
[1] https://techcrunch.com/2017/09/12/the-new-iphone-8-has-a-cus... [2] https://developer.apple.com/documentation/metal/about_gpu_fa...
https://www.extremetech.com/gaming/238246-apple-built-its-ow...
Metal’s main advantage is that it lets you adopt more manual management incrementally (you can basically use it as a DX11 analogue if you’re not interested in low level performance gains). Vulkan is definitely intended primarily for engine developers, not for one-off games.
And such studios prefer APIs that fully expose the hardware, and then build their own abstractions, than something that hides that extra performance features.
All major AAA game engines already support Metal.
https://web.archive.org/web/20100524023205/http://playstatio...
>At the time that DirectX was created Microsoft also largely controlled the OpenGL standard, the success of DirectX in gaming caused Microsoft to largely lose interest in OpenGL leaving it in the hands of the 3D chip OEM’s to advance as an open standard that they could use to pressure Microsoft to implement features they wanted in DirectX. Apple’s adoption of OpenGL and subsequent active participation on the ARB breathed life into OpenGL in mobile gaming because Apple’s iPhone implementation of OpenGL became the “standard” that other mobile phone and chip vendors had to emulate if they wanted to get IOS games ported to their devices. Without some form of “standard” hardware definition, OpenGL drivers and media drivers in general are often just a grab bag of broken inconsistent functionality. Of course in the absence of a “DirectX” like media API of their own design, Apple had little choice but to jump on the OpenGL bandwagon and ride it for gaming, but clearly it is not to Apple’s competitive advantage to be propping up OpenGL support in mobile for all of their competitors. Just as it did for Microsoft, creating their own proprietary gaming API’s is entirely in Apple’s strategic interest…. Why help Android siphon off their game developers by propping up OpenGL?
https://web.archive.org/web/20140606055700/http://www.alexst...
Nobody is expecting Microsoft to add native Vulkan drivers on Windows, why would that be expected of Apple?
Windows has modern, fast OpenGL & Vulkan support due to Windows allowing IHVs (nvidia & amd) to supply the implementation through the Installable Client Driver model ( https://docs.microsoft.com/en-us/windows-hardware/drivers/di... ), which they do.
It's why AAA games have already shipped Vulkan and performed superbly with it (Doom, DOTA2, etc...), since they work with the IHVs to tune & fix bugs and then ship the driver update along with the game drop.
Microsoft doesn't support Vulkan or OpenGL, yet they also are not blocking them. That's the critical difference here. Why is Apple not allowing Nvidia or AMD to do the same on macOS? It's not a question of not supporting it out of the box or doing the work, it's a question of preventing others from supporting it.
Meanwhile, on the Mac, the cheese grater Mac Pro is the only model you can install their graphics cards into and it exited production half a decade ago.
The problem isn't that MacOS lacks Kernel Extensions.
The question is why should Nvidia or ATI take on the expense when there is no marketplace to compete in.
The only Mac you can purchase and use their products in exited production half a decade ago.
Without the possibility of making sales, why would they bother?
Apple's pro software made a big bet on OpenCL in the past, so I don't see them going with anybody but ATI for built in GPUs until they root that dependency out of their software and switch over to Metal for compute.
Nvidia certainly isn't going to put OpenCL performance on an equal footing with CUDA performance, so I can't see them getting a design win with Apple as long as Apple's in house software is still using OpenCL.
And yet: https://www.phoronix.com/scan.php?page=news_item&px=GTX-1080...
OpenCL performs great on Nvidia.
That happens to be not terribly long after Apple started offering rewrites of their pro apps that went all in on OpenCL.
Nvidia did put out a driver for the cheese grater Mac pro so it can use Pascal based cards, which is nice, but I imagine that's motivated by a desire to maintain CUDA dominance.
For comparison the Vulkan project began July 2014 and was released 19 months later. That released on multiple GPU vendors and OSes at launch, which Metal did not. So let's say Metal took 2 years from conception to release, even though it only targeted one platform and one GPU (and likely took less time as a result)
That means OpenGL was abandoned on OSX roughly 3 years before Metal existed as a project at all.
The timelines of Metal vs. OpenGL on OSX just don't line up at all to be any sort of API redirection effort. It just doesn't mesh.
Why? The whole point of having a general purpose computer is that you can install stuff. I do prefer to use the bundled facilities in my OS but sometimes third party alternatives are superior.
(The point of a phone is arguably different.)
That'd be pretty shameful, were it real. How macOS has handled the whole metal saga has been pretty shameful too.
The Linux Standard Base is a superset of POSIX (Portable Operating System Interface [for Unix]), with some small incompatibilities [1]
[0] https://www.opengroup.org/openbrand/register/ [1] ISO/IEC TR 24715:2006 Technical Report on the Conflicts between the ISO/IEC 9945 (POSIX) and the Linux Standard Base http://standards.iso.org/ittf/PubliclyAvailableStandards/ - there is probably a newer version of this report but that is not freely available
Other than the framebuffer there's not even any data of worth on the GPU.
The attack of note that's been mitigated is DoS attacks through webgl, but GPU preemption is a thing now which largely solves the infinite loop in a shader to lock up the machine.
(And re the MMU features upthread, it's just a building block. Just like CPU having a MMU doesn't make your OS magically secure)
If you want to attack the shader compiler go for it, but since that lives in your own process anyway so you could skip that step and go straight to attacking whatever it is you wanted to attack.
> WebGL history (it's been much worse, not DoS only etc).
Such as? All I'm finding are DoS attacks. But regardless WebGL's problems were more due to WebGL and its designs than in vulnerabilities in the drivers or GPUs.
Regarding WebGL vulnerabilities, you can use your favourite search engine to look up vulnerabilities, here are some first hits for RCE bugs: https://www.cvedetails.com/cve/CVE-2012-3968/ https://bugs.chromium.org/p/chromium/issues/detail?id=740603 https://nvd.nist.gov/vuln/detail/CVE-2017-5128
Yet here we are again. If Valve had to port software to Nintendo or Sony; they would be using the native, supported API's. Not porting over Vulkan or OpenGL.
Just use Metal. It really is, very good.
It won't be because Apple decided to make it's own competing standard.
Every big vendor and platform for 3D games and software, has their own graphics API which work better and faster than OpenGL and Vulkan. It is only CAD still stuck on OpenGL (and the proprietary extensions).
Idealism is not the answer to positive end user experience.
They were the ones telling Sony that their efforts for having OpenGL ES 1.0 on the PS3 were not worthwhile pursuing.
OpenGL ES on the PS3 was barely used beyond prototypes and simple demos.
[citation needed]
Not that they have their own API, but that it's at all better or faster than Vulkan. Remember Vulkan primarily came from AMD's Mantle. It's not the creation of a committee catering to the lowest common denominator.
And no, it's not only CAD still stuck on OpenGL. Games use it, too. Most of mobile is also on OpenGL ES. Increasingly more of them use it than they used to, even, as increasingly games are using off-the-shelf engines that are already cross-platform and have an OpenGL back-end.
The single largest consumer OS in the world (Android) only supports OpenGL ES & Vulkan, even, with no proprietary graphics API of any kind.
So lumping together all of these variants and calling them "most used OS" is not useful in any sense. They are very different for users, and very different for devs.
This is specially relevant when you want to develop a game against a graphics API. Samsung has Vulkan on their flagships for a couple years now, but not the mid/low-end devices. Pixel supports Vulkan, but the units sold are so low that they are a rounding error. No other major manufacturer significantly supports Vulkan either. In this and similar scenarios, the framework used by ios may well be the "most used" mobile framework.
Then you're correct by your definition, but not by most people's definition.
Largely due to support in Unity/Unreal. They would be using OpenGL ES still if they had their own engines except maybe the biggest game studios that always have custom game engines/rendering integration.
And even then, it is only required on those that support VR.
Metal is supported on across all iOS devices still getting updates.
Since nearly everyone's GLES 3 hardware both supports vulkan & has vulkan drivers already there's no particular reason to believe that an OEM will decide to just not ship vulkan support. It's more work for them to remove Vulkan from the SoC's base image than it is to just not touch it.
The low-end GLES 2 hardware is the only problem, which is a market iOS simply doesn't exist in at all. So if you're cool with ignoring that market, go for it.
https://godotengine.org/article/abandoning-gles3-vulkan-and-...
Lets see if they have better luck with Vulkan.
True but console is a different beast though, it seems you are focused on that not just mobile which was always just OpenGL ES mainly since '07 until Metal entered the arena.
On consoles/custom handhelds, they have always had their own frameworks to get the most out of their custom hardware and for lock-in exclusives, to compete and advance their hardware as far as possible for the console lifeline, to sell as many games as possible as the hardware ages as game content is where they made profit. Consoles have modified versions of frameworks or their own like gcm from Sony. They do support standard ones but mostly people use the custom ones to get the most out of the hardware and the hardware makers like that.
On desktop, only two essentially in DirectX and OpenGL and was that way for a long time. Portability was fine, DX windows, OpenGL everything else but DX was the major one due to Windows desktop dominance.
On mobile, OpenGL ES on the major mobile platforms, iOS and Android, pretty much the only one since '07 until Metal.
As I mentioned in other areas, not a huge deal to game developers who aren't building their own engine but portability does matter on desktop and mobile, not just consoles which have reasons for custom rendering engines/toolkits.
Using Vulkan is like writing your own language runtime over system calls: you have to handle memory allocation and synchronization on your own.
IMO, this is a common misconception. Or, at least, the extrapolation of it is. Vulkan might require a lot of code to initialize, and has extra responsibilities related to memory management, synchronization, etc., but in my experience the end product doesn't require significantly more code than other graphics APIs. The up-front cost you pay doesn't translate to increased costs everywhere else, at least not to the same degree.
My library supports D3D11, Metal, Vulkan, and OpenGL, and Vulkan is the second-largest backend, but not by a lot (LOC: ~5k Vulkan, ~3.3k D3D11, ~2.5k Metal, 6k OpenGL). LOC is not the best indicator of complexity, to be fair. My OpenGL backend is definitely the most difficult to maintain and the largest, because the API is such a pain to deal with.
I am not saying opengl or vulkan is bad.
Apple Metal launched in 2014.
Sony and Nintendo and NEVER used OpenGL for anything extensive. Sony talked the talk around 2005 and 2006 with the launch of the PS3 and OpenGL ES but PSGL was always more performant.
PLEASE prove me wrong.
Source https://developer.nintendo.com/
Just like Sony did in the past with the PS 3 and GL ES 1.0, they are just testing waters to see which way devs go.
In the PS3 devs preferred to pick Sony's API instead.
Uou have convinced me that Metal might not be so bad... at least is all the consoles have custom APIs then it’s not as unusual as I thought.
There were several efforts in the past to revamp OpenGL (e.g. long's peak), but they all failed. OpenGL was stuck and there was little reason to think the situation would improve. Writing OpenGL code that worked across multiple platforms was worse than it is today to write multiple per-graphics-API render backends.
OpenGL was not stuck, either. OpenGL's AZDO project was alive & well: https://www.khronos.org/assets/uploads/developers/library/20... (just not on macOS because AZDO is GL4.2+ whereas macOS is stuck on 4.1)
This is the world that was born from demoscene, where exploiting cool hardware specific tricks was more valuable than writing portable code.
The bummer about Apple is that they did help fund Khronos/OpenGL ES and subsequently WebGL from that stack that really revolutionized mobile/handheld gaming. They were big in helping open tech like that as well as canvas, html5, svg etc when the iPhone first came out. They killed Flash essentially and brought H.264 to take a big part of what Flash did, video. Part of how they won was using OpenGL ES and a decent rendering hardware device, it was an amazing thing to see in 2007 and changed handheld gaming big time.
Now Apple has Metal, their own rendering kit, that only works for macOS/iOS where OpenGL was easier to then port to iOS, Android, *nix, even use on Windows etc for desktop/mobile games especially. Apple used open rendering to allow easier porting to their platform, now they have flipped and have taken on a big part of rendering on their devices, a big software part that they hopefully will keep well maintained and up to compete.
But really today there are so many great engines that are middle tier in Unity and Unreal for instance that low level rendering frameworks aren't as big of deal to integrate as it is handled by these middle layer engines. Metal being so prevalent on iOS is only because Unity and Unreal support exporting with that as those two engines make up the largest part of mobile games.
There are four major rendering frameworks now with OpenGL, DirectX, Vulkan and Metal, including others like libGCM and flavors of OpenGL like ES/WebGL. This does complicate things for game engine developers, maintenance and portability with four market standards now. On mobile there are now a few instead of just OpenGL ES versions the dominant one since handheld gaming was taken over by Apple iOS/Google Android. Console game development is a different beast than mobile and desktop in terms of rendering frameworks used for many reasons, mainly that the hardware has to age longer and you need to get every bit of performance.
Most game studios now let the middle tier companies like Unity/Unreal/Cry/Source be their engine team now so it isn't as impactful, so studios can focus on game development, design and content. Back when you did have to write your own engine and rendering layer, it was nice to only have two essentially in DirectX and OpenGL on desktop, and OpenGL ES on the major mobile platforms, console development being the area where there are many frameworks and custom ones per hardware device. The slow progress before mobile and new frameworks was frustrating at times but primarily due to hardware progression, currently it is good to advance and get rendering kits competitive again.
On the other hand, when I develop OpenGL programs on Linux, it takes maybe a few hours to fix up the few compile errors I might encounter on OSX. Swapping out the graphics API would dwarf all the other porting work combined.
Seriously, all I want is to be able to write graphics programs using compute shaders and share them among my colleagues who use OSX, Linux and Windows. I don't want to write my programs three times. Is that really too much to ask?
For reference, LibSDL recently added the ability to help initialize Vulkan, in a cross-platform manner. A bit of further info on this is available at https://discourse.libsdl.org/t/sdl-2-0-6-released/23109
The API changed a bit with 2.0 release, the biggest change was support for multiple rendering windows.
1: https://www.khronos.org/news/press/vulkan-applications-enabl...
I would drop this system in a heart beat if I could play all my AAA games on macOS, and I would replace it with a high end iMac Pro. Sadly two problems remain:
- I can't play my AAA games on macOS because things like Vulkan aren't fully adopted and in place yet
- You can't swap out the GPU in the iMac Pro
This is why my next build is going to be a Hackintosh.
Unless you’re deliberately using Windows specific stuff in you non-platform-specific areas like game logic. In which case facepalm.
EDIT: I know it’s not THAT simple but in general why not have a policy to be portable by default, platform dependent only when necessary?
Even then, having to implement that support infrastructure is time consuming if you have never supported that platform before. It is the first game that is the hardest. That is why publishers like Paradox and 2K can just throw almost every new release on Linux nowadays since they are all made on portable engines, are going to support OSX anyway, and they already have the support infrastructure for SteamOS and Ubuntu.
Its not even really an option, either. Since the games are commercial products in many (European) countries they have to by law support them in this way.
Yes I think there’s a good chance it’s compatible. Sorry for the slow response. Hope you get this.
> While Windows, unlike macOS, does have Vulkan drivers from GPU companies, applications sold through the Microsoft Store are only permitted to use DirectX.
You as a user can move to Linux, and game developers should support Linux, but a game which can only be played on Linux and *BSD will be incredibly unsuccessful.
I just got new laptops that will support both GVT-G and PCI passthrough via OVMF so that I can run my bloatware OS in a KVM VM but still get full 3D acceleration. Hopefully Microsoft decides to contribute heavily back to Wine, or maybe open source their 4GB spyware beast to understand what it is actually doing that makes it so large compared to my distro, which does everything Windows does in much less resources both storage and compute.
DX over Vulkan for non-windows is being worked on too, just not by Khronos:
https://github.com/disks86/VK9
https://github.com/doitsujin/dxvk
and VKD3D for DX12 on Wine
Windows supports Vulkan but to get onto the Windows Store you can only use DX12.
- triangle fans
- separate stencil reference values
- events
There are also extra limitations to things like the maximum buffer size, which are exposed via Molten-specific API.Wondering what the code would look like with the helpers. Is this a bit of a "recoding of the wheel" example/exercise by Sascha?
Say what you want about D3D at least it follows a strict take or leave it regime.
I am a really big fan of Vulkan. While it takes a bit more work to get going and does less for you, I find the increased transparency very valuable and more enjoyable than trying to guess what the driver is doing.
the Apple gles implementation is buggy as hell. produces gpu crashes from compliant code etc... I have low expectations. they have made a new annoyance in our lives ... nothing more