I’ve been really impressed by the games sessions so far at WWDC 2023. One of my complaints about Metal has been with the really small amount of community documentation – it can be difficult to find resources specifically on porting from DirectX. It looks like a problem Apple is really beginning to tackle.
Automated conversion from HLSL based shaders is also a really good improvement. I’d love to see them support SPIRV shader conversion as well for personal reasons, but DirectX/DXIL is clearly the best starting point.
Of course the big news is DirectX 12 to Metal translation – through a new Game Porting Toolkit and D3DMetal.
I’ll start with what D3DMetal and the Game Porting Toolkit are not. They don’t automate ports of DirectX games to Mac. They’re not a capability of macOS Sonoma – nor do they ship with Sonoma. They don’t create a starting point for a port. You cannot ship a game with D3DMetal. They’re not open source and the licensing terms seem to forbid using D3DMetal in a shipping title.
D3DMetal is a demonstration tool to show that a game can possibly run on the Mac. Apple provides a gameportingtoolkit command line tool that loads up WINE, and then D3DMetal is patched in to translate DirectX calls. DirectX 11 and 12 are supported. The game has to be emulated through Rosetta – and the game is not optimized.
So – why? It’s strange Apple would invest so much effort into a demo tool.
In the WWDC sessions – Apple pointed out that it can take a long time for a Metal port to achieve any level of functionality. This creates a long delay until the developer can get a feel of how their game feels on the Mac. The idea is this tool shortens that delay so… the developer feels better about porting? I don’t think it was completely clear in the session.
But I could probably guess at a few other reasons.
There’s a lot of doubt about games on macOS and Apple hardware. And there has also been a lot of noise about Apple Silicon not being able to handle DirectX 12 class games. I would bet some of that doubt has been coming from gaming companies themselves. D3DMetal and Game Porting Kit allow Apple to immediately disprove that. Apple is saying “Of course your game can run on the Mac, it’s running right here.” Apple can move the conversation from “Can we port our game to the Mac?” to “Should we port our game to the Mac?”
D3DMetal is not something that is meant for end users (for reasons I’ll get into.) But my sense is Apple also knows some creative Mac users will be downloading this and running games in it. That creates additional pressure for game companies to have to recognize Mac users and port to the platform.
Should Apple make D3DMetal a user feature?
There’s been some talk on if Apple should actually include this translation layer with the operating system. My opinion? No.
What Apple needs to prove is that Macs can not just run games – but run them well. D3DMetal doesn’t help Apple do that – and I think it’s actually kind of risky to release.
Game Porting Kit runs games through Rosetta, which is an immediate performance hit. The games are still tailored for GeForce and Radeon cards – and not for Apple Silicon. Because these games are translated on the fly there can be massive stuttering in the games (which is common with WINE and other translators.) And the translator can’t take advantage of other features like offline shader compilation.
If Apple wanted to put their best foot forward for Mac gaming – this isn’t it. The takeaway would be that while a title can technically play on Mac, it still plays better on a PC. And thats a reputation Apple needs to shed.
But what about Proton?
Proton is Valve’s translation layer – built on Vulkan – that allows Windows games to run on Linux and the Steam Deck. If Valve can get a great experience out of game translation, why not Apple?
As far as I know – Proton only supports Intel compatible platforms. So Proton is able to deliver better performance because it doesn’t have to deal with CPU instruction translation.
But the other thing to remember is Proton isn’t entirely automated translation. There is a lot of human effort going into Proton – with developers manually patching games for compatibility. Infamously – Valve has even patched games in Proton to eliminate problems that affect the game when running on Windows. Apple’s not interested in setting up some side business patching games manually like Valve has.
Even games running on Windows can be inconsistent between driver versions and vendors. And Apple really doesn’t want to put in the effort to support a real, consumer ready version of DirectX on Mac.
I haven’t run D3DMetal myself yet – as I don’t have any Macs on Sonoma. But from Apple’s demos it’s pretty clear that it is not the greatest performance. Apple claimed a native Mac port had double the performance of the D3DMetal demo.
Because I can feel the Mac YouTubers already firing up their video editors – D3DMetal should never be used for benchmarking Macs. If it performs well against a Windows PC thats great. But running games on D3DMetal isn’t the same as a real port. The games are not optimized. No one should take away any performance conclusions from this tool.
(For what it’s worth – I’d say the same thing about WINE or Crossover. Windows games are optimized for Radeon and GeForce GPUs – not Apple Silicon. These solutions ran better when Macs also used GeForce and Radeon GPUs. But Apple Silicon GPUs have a unique design and require some unique optimizations through Metal.)