r/GraphicsProgramming • u/PeterBrobby • Apr 15 '24
Is Vulkan a failed API?
I know it's modern and can do things that older APIs like OpenGL can't but how many developers are benefiting from the added verbosity and complexity?
The OpenGL reddit has more members and higher engagement than the Vulkan reddit despite the fact that OpenGL hasn't been updated in 7 years.
Personally, I would prefer if an API like Metal had cross platform support, it's modern and far less verbose.
40
u/cafuffu Apr 15 '24
Verbosity is not a problem. For what it's worth i prefer to write Vulkan code rather than OpenGL. Vulkan is more explicit so it is complex but OpenGL on the other hand doesn't eliminate the complexity, it rather hides it behind a very clunky and annoying API.
6
Apr 15 '24
[removed] โ view removed comment
24
u/cafuffu Apr 15 '24
Mostly the state machine aspect of it. Granted though, i know it has somewhat improved now with the direct state access functions but still there is a ton of state that the context tracks still.
Also, multi threading is a pain.
2
u/Revolutionalredstone Apr 15 '24
Happy birthday and excellent question +1 (I'm sure he's atleast partially correct but also super curious to hear his exact exploitation)
7
u/wrosecrans Apr 15 '24
I think it's fair to say that Vulkan hasn't quite reached absolutely maximalist goals. But it's not reasonable to say it failed. It was always meant as a hyper explicit toolkit for people building extreme game engines and renderers who needing the last X% from the GPU that something like OpenGL couldn't ever give access to. The idea was always kind of that a handful of major game engines would use Vulkan and that would reach a huge percentage of gamers and end users. And your average "graphics 101" student doing their first 3D app could use some higher lever rendering library which may or may not be using Vulkan in the backend.
I do think some design decisions in Vulkan make it a pain in the neck for some use cases. But there's a huge gap between "not to my personal niche" and "failure."
4
u/msqrt Apr 15 '24
It's just a different use case. Vulkan was designed to enable teams of engineers to write efficient GPU software as a full-time job, and in that space it's a resounding success. But Khronos really dropped the ball on hobbyists -- there should have been an official higher-level version or wrapper instead of everyone and their mother having a custom solution (they're probably great, but I have my own OpenGL equivalent that I guarantee is better).
It seems like WebGPU will finally be this hobbyist-friendly API. It has many of the more modern and reasonable design choices, while being possible to set up and draw stuff with in a couple of hours. Now it just needs to be supported widely enough, and we should be good for a while.
4
u/hishnash Apr 15 '24
The reason many of us prefer metal is the design aims of apple were very different to that of the commits that makes up the Kronos group.
Firstly apple did not just build metal for games, and even more so they did not just build it for large game engine middle ware dev houses (like Epic with Unreal etc).
Apple wanted an API that would be easy for regular app developers to use ad-hock (even if your not doing a game but just need some nice smooth 2D rendering etc) there are a surprising number of apps on iPhones and macs that have custom metal backends for 2D content. Apple wanted this to be approachable for devs that were not experienced graphics programers.
The other think apple wanted from metal was an api that they could use as the backbone of the OS compositing engine and as a hybrid compute display stack that lets professional applications (and the OS) mix compute and display tasks easily. The selection of c++ as the basis for the shading lang is a clear choice here to make it easier to add MTL support to existing c++ code bases (such as CUDA) but it is also there to be more approachable to non graphics programers.
There are members of the Kronos group that absolutely did not want VK to take the pathway of MTL.
Of cource the other benefit MTL has over VK is the much higher HW target, this helps it avoid needing many of those options and verbosity as the api designers only care about Apples GPUs.
1
u/sadgandhi18 Dec 14 '25
Why are there so many apple shills in this subreddit
2
u/hishnash Dec 14 '25
a lot of people in the industry consider Metal to be a much nicer api to use than VK.
This has nothing at all to do with the company that authored the API but other the api itself.
1
u/sadgandhi18 Dec 14 '25
Anything is going to be nicer compared to vulkan! That's a given. Keeping things locked down is worse for us all.
Metal had potential, but given who governs it and it's stagnancy? I wouldn't recommend it.
1
u/hishnash Dec 14 '25
What do you mean locked down? I would not consider metal any more locked down than any other graphics api.
I am not sure metal is stagnant either, We have seen a lot of rather huge changes with MTL4.
As to if you recommend it that depends the platform your looking to build for of course.
However if you looking to for a first api top tart learning graphics dev with MTL is a great place to start.
Since you can start out with higher level concepts leaving thing like memory and tracking up to the driver and then gradually adopt lower level untracked models it is a great api for new-comers to the industry.
And more those with more experience who just want to play around with new ideas and do not want to spend 3 weeks re-implementing a memory manager when they are interested in a new way achieving some new visual effect. Once you lock down the effect sure you can port it over to all the apis you need to target but MTL is a great place to start out as a playground domain.
1
u/sadgandhi18 Dec 14 '25
With all due respect, it's precisely the details about memory and the bottlenecks in dealing with them that are what beginners should learn. If all you want is something nice on the screen, why bother with learning a graphics API? These weren't meant to be easy, or simple. You can't magically evaporate complexity without giving up power/shifting that complexity elsewhere.
Why don't people understand this simple fact? Recommending Metal to beginners is dooming them to learning to build for a locked ecosystem, with barely any variety of opportunities. Let them learn OpenGL or DirectX for that matter.
Lastly..
The Metal api isn't locked down? That's news to me! So surely it's readily available to be used on different platforms! Oh it's not? That's fine, atleast we have some common intermediate compiled version of it? Oh.
2
u/hishnash Dec 14 '25 edited Dec 14 '25
> With all due respect, it's precisely the details about memory and the bottlenecks in dealing with them that are what beginners should learn.
yes but being able to learn these progressively after they get the first trig on screen makes it a lot easier.
With metal you can migrate from tracked to untracked bit by bit. This makes it much more approachable for beginners.
The learnings you get form using Metal can be transferred to any other api. You not learning the api your learning the concepts, and the underlying mathematics. This is all very transferable.
DX, GNM, GNMX and NVN are just the same metal with respect to the platform constraints.
1
u/sadgandhi18 Dec 15 '25
There's two parts of graphics.
The api, that you learn. And the general 3d math with the general 3d pipeline. The latter is a must have, and you will not be able to use any api without it, but the former is not completely swappable, if you start with it to learn the concepts itself.
You can't transfer metal's specific api to another one. You'll have to learn how the new specifications gets things done.
We're just arguing over definition and results. You tie learning 3d to the api itself, I claim you learn these independently, and merely use the api for application of your knowledge.
1
u/hishnash Dec 15 '25
While api knodelge is not completely swappable it is very portable, the api surface for graphics apis it nat large.
There is very little that is metal specific that does not have some analogy in DX or VK.
There is a good bit that is TBDR gpu specific once you get into advanced optimisation but that is very applicable to mobile VK dev.
1
u/Super-Library6844 Feb 03 '25
Why do you hate the Vulcan API? It is the best API out there "closer to the metal" while being multiplatform. Optimization for CPU, GPU, memory, and system resource usage of your application, and support both compute and graphics in one giant package. Offers extensions over the base system to do things like error checking beyond what the IDE can do.
2
u/PeterBrobby Feb 20 '25
I don't like it's design. It's too verbose. It's hideousness is holding graphics back. Programmers don't like it, they tolerate it because it's the only modern cross platform solution.
5
u/shadowndacorner Apr 15 '24
Amusingly, with all of the translation layers available for it, D3D12 is probably the most portable modern API today, and it's much closer to Metal than Vulkan. Not that you should directly target it if you aren't primarily targeting Windows - it's just funny how things have worked out.
1
u/IRON_FiNN May 19 '25
Vulkan is one line of code. Itโs a 10000 line code made into an algorithm itโs based on OpenGL. It was designed to make direct 3d and OpenGL games compatible while bridging c++ into every platform including mobile. I donโt know about now but when it came out it was super impressive from a fps standpoint.
0
0
Apr 15 '24
[deleted]
9
u/Nebulous39 Apr 15 '24
Vulkan - your car where you can not just drive anywhere but also can look and change how engine works, and change number of wheels and shape of car.
I love this analogy
3
u/DrDumle Apr 15 '24
Wasnโt Apple the ones who started the WebGPU initiative?
7
u/IceSentry Apr 15 '24
Yes, but they keep making the spec worse by refusing to use things that are used everywhere else like SPIR-V. They like the idea of webgpu but they don't seem to care about cross platform features. Pretty much every time you see something weird or too restrictive compared to vulkan or directx in the spec it's because of apple.
1
u/DrDumle Apr 15 '24
Was it apples fault they didnโt go with glsl? I remember something about webgpu having a weird shader language. Was that apples doing?
2
u/IceSentry Apr 16 '24
Yes and no, webgpu couldn't use SPIRV because of apple, but deciding on WGSL wasn't just apple's decision.
3
u/AssignedClass Apr 15 '24 edited Apr 15 '24
Apple also started WebKit. You'd think they'd be more supportive of browser based products, but they kinda aren't. They want everyone on the app store to strengthen their walled-garden business model.
Major tech companies are literally so large that they can pour resources into expensive projects like this that don't fundamentally align with the direction that the C-suite executives want to take the company.
It's still smart on their part. If WebGPU really takes off, well they got people literally defining the term "industry expert" working for them and will have the capacity & foresight to really support it, but Metal gives them something better for vertical integration.
2
u/DrDumle Apr 15 '24
How important is apples cooperation for WebGpu? Couldnโt webgpu implement things without apples help?
1
u/AssignedClass Apr 15 '24
That's a good question... someone with more knowledge on the inner workings of the W3C would have a much better answer for you.
My answer with my very limited understanding is "Yes WebGPU would still be a thing even without Apple", but I have to believe it would be a big impact if Apple suddenly decided to put no resources towards it, but I'm not exactly sure on all the specifics.
3
u/pjmlp Apr 15 '24
Vulkan is a car delivered in a LEGO Techniks package that one needs to build before driving.
Google was the only one pushing for SPIR, and it was Chrome team that dropped WebGL 2.0 compute efforts, advocating for focusing resources on WebGPU, not Apple.
0
Apr 15 '24
[deleted]
1
u/pjmlp Apr 16 '24
All examples of LEGO construction kits, at DUPLO level, it is still not a ready made car.
And WebGPU still being available only on Chrome is better because?
WebGL uses DirectX on Windows, and Playstation 3 used WebGL for their dashboard, on top of LibGNM, and WebGL on Safari nowadays uses Metal, thus whatever OpenGL on Mac does was a lame excuse to rip Intel's contributions out of Chrome.
0
u/Economy_Bedroom3902 Apr 15 '24
Just to add to this. If you have a use case where you need the features of Vulkan not present in other graphics APIs: You're using AI in the graphics pipeline, you're adding or removing steps from the common graphics pipeline, you're supporting more obscure or limited devices, you have a sufficiently complex multistage graphics pipeline, whatever. You basically can't just use OpenGL instead no matter how nice and easy it is for all the mainstream game programmers who don't need any advanced features.
Vulkan isn't a failed API if only for the same reasons excavators aren't a failed vehicle. You simply can't dig big holes with your car, no matter how popular cars get.
0
Apr 15 '24
[deleted]
2
u/T34-85M_obr2020 Apr 15 '24
Would you might listing some of these communities? thanks
0
Apr 15 '24
[deleted]
3
u/waramped Apr 15 '24
The GP discord is linked in the subreddit sidebar, direct link here: https://discord.com/invite/Cy7tqUZ3
67
u/Revolutionalredstone Apr 15 '24 edited Apr 15 '24
Vulcan is WIDELY misunderstood.
Most people should not be directly using it.
The fact that you are comparing it to OpenGL shows a problem.
Vulkan is MUCH lower-level than OpenGL. This control comes with the cost of greater verbosity and complexity in the code. Vulkan requires more setup and management of resources, such as memory and command buffers, which are generally handled quite well automatically by OpenGL.
Most of my friends who invested the 3-6 months to convert to Vulcan saw their performance decrease compared to easy to use OpenGL.
The exposure (and requirement) of ultra low level threading might be a benefit to some low level optimization experts on AAA titles, but most people can't do a better job managing those details than OpenGL was already doing!
The reality is people really understood OpenGL, it's just a driver with an API for users to draw 3D things!
When Vulcan came out (something much closer to a raw driver) people didn't know what to think of it and some idiot said oh it's just faster OpenGL and a million dipshits wasted their time hahaha.
The reality is these things are miles apart, even people who claim to directly use Vulcan don't actually do anything like that, they create object models and god-classes to make it reasonable.
IMHO you should really just use BGFX or other simple unified layers and let it pick Vulcan as the backend automatically where appropriate.
Failing that just use OpenGL, It runs like a dream on anything, and I've never seen a legitimate reason for bad graphics performance, a bit of LOD + frustum culling and you can render anything with OpenGL! here's some footage my newest OpenGL Minecraft clone: https://imgur.com/a/MZgTUIL (running on a computer with no GPU)
Enjoy