133 points · by coffeeaddict1 · 4y ago · 47 comments
That's a bit of a red sign. It may work on your machine for your application. Conformance tests are a great mechanism to understand how it's going to work for other applications you haven't tested. Hooking up OpenGL CTS on macOS shouldn't be too hard - we got the Vulkan CTS running there a while ago.
Practically speaking, this project is interesting. While generally I'd recommend looking at Vulkan instead of OpenGL 4xxx (as opposed to, say OpenGL ES 3.1), in this case Vulkan -> Metal is much more involved than OpenGL -> Metal. The low level abstractions of Vulkan just don't play that well. For example, MoltenVK doesn't really record any command buffers before you submit(), and that's an abstraction failure. So OpenGL -> Metal is an interesting way to have portable code with a more flexible (better?) abstraction, assuming you can make it work :)
There are no details on their repository:
There are missing features for older versions too:
- bufferRobustness2 - geometry shaders - transform feedback - tessellation is super but very slow and problematic
Geometry shaders and transform feedback are terrible features that most GPU vendors would like to get rid of because they don't map well to modern hardware. But games do use them and everyone who isn't Apple has to maintain backwards compatibility. So it's unlikely that those will ever get supported in Metal. You could probably emulate them with varying levels of compatibility/conformance which might be good enough for a lot of games.
It might not support every game, but proton isn't 100% either on Linux.
#define GL_SILENCE_DEPRECATION 1Wrappers are used by the majority of apps anyway, for example WebGL. Apple doesn’t get to say: “We want your JavaScript apps to use our API instead, and we’ll make the development experience subpar if you’re using WebGL.” — they shouldn’t have that kind of power over C apps either.
The software industry doesn't make a lot of sense.
OpenGL ES works great on curent iOS hardware/software but the Simulator support is broken with newer iOS images. In the Simulator, GL ES is now unusably slow, buggy, crashy.
I have an app store Mac/iOS app which is written twice, but the two versions share lots of source, including all the GL rendering code, which is complicated. My strategy has just been to silence the GL deprecations and carry on, as it's not worth the time to rewrite the renderer in Metal, and the performance is great on modern GPUs. I just do cosmetic updates to the UI code as needed.
Application -> OpenGL -> Zinc -> Vulkan -> MoltenVK -> Metal -> Hardware
Zink has outperformed native GL drivers even though it introduces an extra layer through vulkan.
Ideal world, we'd have direct GL to metal or hardware, but implementing a GL driver is a big effort.
That is not the case here (Radeon RX 5700 XT, Linux), Zink is consistently slower than the "native" OpenGL. A quick test with Dhewm3 ("modernized" version of the Doom 3 engine) has the native driver running 1.5 times faster than Zink and with an engine of mine the native driver is ~4 times faster.
I don't have many games to benchmark on but in general Zink tends to be slower than a native driver, but depending on the hardware and game the difference might not be noticeable in practice (without an FPS counter). In the future when hardware is faster than today it might not make much of a practical difference even in benchmarks.
I for one am not interested in writing the same graphics code across multiple OSes and OpenGL provides a perfectly fine API for my needs.
Direct3D is far easier to use.
> provides a lot of functionality
In a haphazard, difficult-to-use way that lags the state of the art. Because Microsoft controls DirectX, they can look at what the GPU manufacturers are doing, draw up an API spec for the advanced stuff and the GPU manufacturers would hew to that spec. OpenGL is designed by committee, a committee largely staffed by ancient CAD software vendors who insist on backward compatibility and it holds the API standard back. There's a janky extension system in place to allow GPU vendors to add functionality -- in proprietary, mutually incompatible ways that require the developer to write multiple code paths per unit of extension functionality.
Plus there's GPU debugging support integrated into Visual Studio. OpenGL doesn't have nearly the tooling that DirectX does.
Honestly, OpenGL should have been abandoned, and DirectX made the standard, 25 years ago. The only reason it wasn't was John Carmack, for the past 15 years even he's conceded that DirectX is the better API.
> I for one am not interested in writing the same graphics code across multiple OSes
Use a game engine. It's got back ends for DX, Vulkan, Metal, even OpenGL (although that may change).
If you must code to some 3D API, use DirectX. Natively supported on Windows, supported via DXVK on Linux and DXVK+MoltenVK on Apple (though Microsoft is working on native DX for Apple hardware, probably translating straight from DX to Metal.)
Latest unity engine with their new universal 3D pipeline seemed to do it for good.
unreal engine 4/5 don't even have opengl anymore as far as I know.
Godot4 engine has a vulkan backend, but it seems it needs more testing.
I play on native elf/linux.
Then, games which run on rottenfruitOSes without an engine with a native metal backend "just need" to ship with the vulkan->metal translater (molten something).
As far as I know, this is how CSGO runs on vulkan: valve did package the game with the DX(11?12?)->vulkan translater.
OpenGL hasn't been a popular API for game development since around the late 90's.
CSGO has a builtin DX to OpenGL translation layer. They're not using Proton or DXVK, it's Linux native OpenGL. Hopefuly we get Source 2 and native Vulkan sooner than later ..
It's D3D9 to OpenGL, and it's open source and called ToGL. On Linux you can also opt in to use DXVK by using a launch parameter.