Hacker News new | ask | show | jobs
by doikor 672 days ago
A good start would be to support some existing API (Vulcan and OpenGL) instead of making their own (Metal).

Or throw in the towel and do what Linux gaming did and just make a compatibility layer for Windows APIs and DirectX (wine/proton). Though this compatibility layer stuff has big issues with anti cheat software making it not really suitable for many online games.

1 comments

Games written with Vulkan can run on MacOS with the help of the MoltenVK [1]. You don't need to rewrite the game, just recompile for MacOS. The game can use Vulkan API but loads the MoltenVK shared library at runtime. It acts as a translation layer for Metal which is very similar to Vulkan. There are some gotchas, such as you can not use geometry shaders because Metal does not support them.

[1]: https://github.com/KhronosGroup/MoltenVK

> You don't need to rewrite the game, just recompile for MacOS.

The word "just" does a lot of heavy lifting in this sentence. First you need to get your game running on ARM64, which likely won't work out-of-the-box unless you already ported to smartphone/Nintendo Switch. Then you simply map all the functionality to MacOS syscalls, debug a second version of your game, polish it, and release it but without Metal support so you can use MoltenVK to run it. The number of video games that fall into this category of "released for 64-bit MacOS but doesn't support Metal" is minuscule. 99% of the video games released today are an x86 Windows binary, and if you can't run that you're boned. Developers will not build you a special MacOS version of their Vulkan game so you can mess around with translation layers.

You could also use Linux and get upstream Vulkan drivers that work out-of-the-box. Apple's obsession over Metal is part of the reason I left MacOS and I truly pity anyone that depends on MoltenVK to run their favorite software.

Yeah the fact that you have to compile a separate binary is already too much work for most developers. Just not worth the effort for less then 2% market share.