179 points · by mfilion · 6y ago · 90 comments
In a way I find OpenGL too complicated sometimes, some of its abstractions don't really make a whole lot of sense on modern hardware. Having a lower level API can make some code simpler to write, at least in theory. When I use OpenGL I often find myself thinking "I sure hope the driver will manage to understand what I'm trying to do and not end up doing something silly".
Note that my exposure to OpenGL comes mainly from console emulators though, and that's obviously very biased since emulators need to mimic very quirky behaviors of the original hardware, and that often results and very un-idiomatic GL code.
In 4.x they added DSA[1], which lets you avoid the global state a lot of the time. There's still some, but much less.
I do agree, though, that opengl is somewhat a mess, and vulkan really overwhelming.
These days I rarely ever bother with threaded OpenGL, and I stick to one context per thread, using OS surface sharing primitives (DXGI, IOSurface, etc.) to communicate.
These things are obviously related.
From my work in OO langs, I believe it is possible to wrap OO code in functional code to some degree without rewriting, assuming that global references can be intercepted and resolved to local ones somehow, and that the state reference that encompasses all the globals is an immutable data struct
glBeginState(&stateObj); glEnable(GL_BLEND); glDepthTest(GL_LEQUAL); glEndState(&stateObj);
and then later on you'd do glBindState(&stateObj) to apply it.
I have high hopes for WebGPU though and I am going to migrate my renderer to it soon.
I get it, Vulkan is low level, but still.
Khronos is now driving the Anari effort, because most visualization toolkits could not be bothered to move forward into Vulkan.
Pity that they decided to just bother with C99 though.
Isn't this the trend nowadays? I've seen recently that simple languages are trending again, languages like C, Go, Zig, Erlang, Lua. I think we hit the ceiling with mammoths like C++ and Scala.
That is, in fact, precisely the wrong advice.
Vulkan runs on Windows, Linux, and OS X (via MoltenVk). Nothing else does.
OS X runs OpenGL 3.Ancient and has now dropped OpenGL. OpenGL drivers for Linux tend to be laughably worse than the Vulkan drivers.
All of the major gaming companies have basically said "We have no OpenGL jobs. We have a ton of unfilled Vulkan jobs."
If you aren't using DirectWhatever, Vulkan is going to be the only useful 3D API very shortly.
Vulkan lets dev do things directly.
You could say opengl is one "layer of crap" Carmack was talking about.
I'm still happy to use it though.
Use the bgfx.
If you use it, then you'll get no help from the platform on getting it to run. Random parts may begin to break, and the intention is likely an eventual removal.
Source: worked on GPU drivers for over a decade and had to make decisions like that.
Apologies in advance if this is asking questions that you are not allowed to comment on.
And no, I am not using LLVMPIPE.
For example ACO (new shader compiler for radv and potentially radeonsi) complies NIR into AMD GCN / RDNA machine code.
Could you expand a bit on this? Are you referring to DXVK? Or does Zink have support for DirectX?
> My expectation when I clicked into the timediffs page was that zink would be massively slower in a huge number of tests, likely to a staggering degree in some cases.
> We were
So performance was better than expected on a small handful of tests out of tens of thousands?
Competition!
Khronos did the first part with Khronos and SYSCL, but only after taking a beating from CUDA, so the ecosystem never cared, and OpenCL 1.2 became 3.0.
Vulkan Compute is even worse than OpenCL in what concerns existing tooling.