Mostly we code...sometimes we write. Every once in a while, we podcast.

We're Getting There — CrossOver Support for DirectX 12

In 2022 DirectX 12 support is a top priority. That being said, our CrossOver developers are working through the challenge of developing support for DirectX 12 in two distinct gaming environments. The obstacles in Linux are not the same as the obstacles in Mac. Let's take a look at how CrossOver supports DirectX 12 and what the challenges are.

CrossOver uses VKD3D to run DirectX 12 games. VKD3D is a 3D graphics library built on top of Vulkan. Currently, lots of work is being done to improve VKD3D performance. With the help of the Vulkan descriptor indexing extension, which allows for functionality similar to DirectX 12 descriptor heaps, Vulkan descriptors are written less often and far less GPU memory is used. As a result, VKD3D can support games that use enough descriptors to require resources from Tier 2 and Tier 3 hardware.

All that means support for DirectX 12 on Linux is arriving in 2022 with CrossOver 22. Support for DirectX 12 on Mac is another story. Why, you ask?

On Mac, there is an additional layer of complexity when trying to use VKD3D for DirectX 12 games. That layer of complexity is Metal. Metal is Apple’s low-level, low-overhead, hardware-accelerated graphic and compute shader API. It was introduced back in 2014, and was designed specifically for Apple's GPUs. Metal does provide support for some other GPUs, but because it was geared for Apple hardware it is different from OpenGL, Vulkan, or D3D12 and its predecessors.

In general, Metal does tessellation differently, and is missing geometry shaders and transform feedback. Specific to DirectX 12 and Metal, there is an issue with limits on resources. Generally, games need access to at least one million shader resource views (SRVs). Access to that many SRVs requires resource binding at the Tier 2 level. Metal only supports about 500,000 resources per argument buffer, so Tier 2 resource binding isn’t possible. Metal’s limit of half a million is sufficient for Vulkan descriptor indexing, but not for D3D12. This limitation means CrossOver Mac can't support Tier 2 binding and therefore a lot of DirectX 12 games will not run.

Another problem is that DirectX 12 uses GPU virtual addresses (VAs) to refer to resources for several things; most significantly ray tracing. According to Vulkan, their buffer device address (BDA) extension allows for the creation of complex data structures required for ray tracing, and useful for DirectX 12 porting. However, Apple has yet to add support for VAs or BDAs, insisting that existing argument buffer support is sufficient for what games want to do. While this may be technically true, it requires game designers to make a targeted effort to run on Metal. It is difficult for translation layers (i.e., MoltenVK or VKD3D) to support BDAs/GPU VAs on top of argument buffers, because argument buffers require you to encode the buffer reference into a separate argument buffer, which makes it more comparable to a Vulkan descriptor set or a DirectX 12 descriptor heap.

Considering these obstacles, we believe support for DirectX 12 on Mac could arrive as soon as CrossOver 23. Keep an eye out for updates, as we will be posting about the progress of DirectX 12 support on Crossover for Mac when we have news to share.

Cheers!

About Meredith Johnson
Meredith has been with CodeWeavers since 2019, and currently wears both the QA Manager and CrossOver Product Manager hats. After getting her PhD in linguistics, she somehow stumbled into the Free and Open Source Software world. When she isn't testing CrossOver, she's probably perfecting yet another bean stew, jogging slowly, buying even more linen tunics, doing a face mask or doting on her perfect chunky baby. 

The following comments are owned by whoever posted them. We are not responsible for them in any way.

Maybe it’s finally time to start writing straight DX -> Metal translation layer.

What’s the point of another Vulkan complexity layer if even most prominent vk games like Doom, Wolfenstein or No Man’s Sky can’t be played on MacOs?

Or Apple magically start to invest in devs to develop proper Metal Mac games.

Which would not happen, so market is there :)

7 1

Thanks for the concise, cogent, and relevant details regarding macOS and support for DirectX 12.

May you, the team, and your loved ones have a safe and happy holiday season and New Year.

2

Interesting follow through.
It boggles me why Apple would shoot themselves in the foot like this? Is there a reason for the 500K limit and could it be increased in a future Metal update? Anyways I guess they have their reasons.
The other drawback is that they tie a lot of these updates to the OS, so it might mean that if anything changes it would be towards macOS version after Monterey.

Dear CodeWeavers,

thanks for the awesome description, it is finally exactly what I was looking for to help me understand why it's hard to port Directx 12 to Metal. I see however that Proton runs Directx 12 games successfully on Linux using open-source Valve vkd3d https://github.com/HansKristian-Work/vkd3d-proton , and just out of curiosity - will you be using the same vkd3d implementation as Proton?

Cheers and Merry Christmas!

3

Anatoly Vasilyev wrote:

Dear CodeWeavers,

thanks for the awesome description, it is finally exactly what I was
looking for to help me understand why it's hard to port Directx 12
to Metal. I see however that Proton runs Directx 12 games
successfully on Linux using open-source Valve vkd3d
https://github.com/HansKristian-Work/vkd3d-proton , and just out of
curiosity - will you be using the same vkd3d implementation as
Proton?

Cheers and Merry Christmas!

Hi there,

Not quite. As the GitHub page explains, vkd3d-proton is a fork of vkd3d. We will be using upstream vkd3d in CrossOver.

Best,
Meredith

2

I'll keep paying for Crossover because you and the team are technological wizards who magically make games playable on my Mac. I hope Apple gets gaming on macOS someday but I won't hold my breath. Thanks team!

11
CodeWeavers or its third-party tools process personal data (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in our Privacy Policy. You accept the use of cookies or other identifiers by clicking the Acknowledge button.
Please Wait...
eyJjb3VudHJ5IjoiVVMiLCJsYW5nIjoiZW4iLCJjYXJ0IjowLCJ0enMiOi01LCJjZG4iOiJodHRwczpcL1wvbWVkaWEuY29kZXdlYXZlcnMuY29tXC9wdWJcL2Nyb3Nzb3Zlclwvd2Vic2l0ZSIsImNkbnRzIjoxNzA4NjEzODE4LCJjc3JmX3Rva2VuIjoiZVRheUxmd3pzcExudlVQVCIsImdkcHIiOjB9