I just read “Google Continues Working On “Magma” For Mesa Cross-Platform System Call Interface” on Phoronix and didn’t get it. That made me realise my knowledge and understanding of these things is barely existent. I did write an MS paint clone on linux in C++ a really long time ago and the entire thing was with opengl (it looked like crap), but since then… nothing.
So my understanding is that the graphics card (or CPU if there’s no graphics card), writes to a component which is connected to a screen and every cycle (every 1/60 seconds if 60Hz) the contents are sent or read by the screen. OpenGL provided a common interface to do so, but has been outdated since… a while and replaced by Vulkan. Then there are libraries either built on top of are parallel to OpenGL. Vulkan can be parallel or use OpenGL if that’s the only one supported IIRC.
However, I’m not sure if OpenGL is implemented at the hardware level (on the graphics card), software level, or both.
Furthermore, I don’t understand where Magma, Meta, and MESA come in.
Maybe my core understanding is wrong or just outdated. I can’t tell. Can anybody eplain?
Not an expert, but I’ll give it a shot. That way someone will speak up to correct me. 🐸
With an AMD GPU on Linux, you’ve got your kernel
amdgpu
driver which talks to the hardware, loads firmware, etc.Sitting on top of that is Mesa, which provides an opengl and vulkan driver. Your application talks to the opengl driver which talks to the kernel driver which talks to the hardware.
Windows has it’s own graphics stack, which has video card drivers and DirectX drivers.
Metal is Apple’s proprietary Vulkan knock-off, which seems to exist to force game devs to write games that only run on MacOS. This hasn’t really worked.
Magma seems to be about inserting a layer between the kernel driver and Mesa, so you can use Mesa OpenGL drivers on top of Magma on Windows kernel drivers? That’s not really something most people are looking to do.
Since we’re talking about Apple, there’s an upcoming library and spec called WebGPU that, contrary to it’s name, is a higher level cross platform graphics library. It’s an interesting idea, write once and depending on your platform, it would use the corresponding platform’s preferred backend (e.g. Direct3D on Windows, Metal on Macs, etc). It’s supposed to be promising and provide a easy way for any existing dev to hop in until they had to give up on SPIR-V support and come with a Metal-like shading language just to appease Apple so that they would support it due to Apple’s existing legal disagreements with Khronos.
And from what I’ve seen from WGSL, it’s nowhere as nice as GLSL and HLSL.
So yea, if you need any more evidence of Apple’s shitty attitude in the space.
They do seem to alternate between making MacOS graphics worse and wondering why nobody’s making games for MacOS.
Management seem to think that desktop Mac has the same market share that iPhone does and keep wondering why throwing their weight around isn’t working.
I think it’s more like Vulkan was a Metal knockoff. Metal released (for mobile) June 2014 and Vulkan research kicked off July 2014. Vulkan was only announced March 2015, and I would think it took more than three months of work for Apple to release Metal for macOS June 2015. And then Vulkan’s specs and SDK were released in February 2016. Though I doubt Apple was pushing for Metal to become an open cross-platform standard either.
AMD donated the Mantle API to the Khronos group (which Apple has been a part of since 2008 focused on OpenCL) and that group developed Vulkan. Of course Apple has a proprietary version. They have their own silicon, own OS, why wouldn’t they have their own graphics layer? Neither of them are knockoffs. Vulkan is open source and widespread for many applications, Metal is proprietary, and applies purely to Apple OS’s.
Vulkan was the successor to AMD’s Mantle API from 2013, though. Metal wasn’t first.