Why is DX12 so much slower than DX11?

DirectX 12 is like Vulkan in that the best implementation will always be a bespoke game engine. You mention that the engine for AotS was built for DirectX 12 but that’s only part of the picture. The best performing DirectX 12 and Vulkan games have engines that were tailored made for those games. Doom (2016) is another fantastic example. It’s Vulkan implementation is insanely fast to the point it runs on just about everything.

2 Likes

After ages, I gave DX12 another try today across a few editor versions, all in URP, all running on Unity 2022 since I’m not interested in U6 for now.

FPS is essentially halved in every single test scenario, with some test scenes I ran having only a 30% drop (yippee).

An average of 50% FPS drop in real scenes you’d usually work with (open world RPG type scenario with NPCs, some physics, water, sky, vegetation).

Not a single setting helps to improve this. Is there any reason to use DX12 other than HDRP’s ray tracing support which doesn’t even exist in URP? I’m on a 3080 with a 7950x3d here and the whole reason to even use it was improved performance in real-game scenarios and CPU alleviation via split graphics jobs from my understanding, yet the performance is quite literally halved.

The worst case I had was a 16-22 fps average in a scene running DX12 vs 55-60 in that same scene running DX11. I am testing the editor because nobody is going to suffer through this much pain developing on DX12 to then see if maybe a build is faster or the same. I don’t think I’ve met a single real person on any developer discord or sub-forum saying DX12 is usable. Not even one person.

Are there any published sample demos from Unity where we can swap from DX11 to DX12 and observe those incredible gains ourselves? I mean an accessible demo, not a YouTube video or a fancy graph PNG with a big bar above dx12 and a small bar above dx11.

2 Likes

I believe that a lot of memory optimizations and performance optimizations have been done during U2023 and into U6, with regard to DX12.

In U2022 you are right, I see the same frame rate drops and massively increased GPU memory consumption. DX12 in U2022 is not a realistic option.

I’m waiting for U6 to become LTS, then giving it another month or two for incremental updates, then I will switch there and give DX12 a fresh go.

I wish that were the case, but unfortunately my experience with Unity 6 is exactly what @Bwacky just described. Any performance gain over 2022.3 is negligible in all of my projects, independent of quality settings.

Strangely the worst part is actually that frametimes in play mode are almost 4 times higher compared to DX11 in all of my projects, making iteration nearly impossible. I thought this is the exact thing DX12 was supposed to improve, shifting load from the CPU to the GPU which should be most apparent with the CPU overhead from the editor, but it seems that the exact opposite is the case. The frametimes are only doubled compared to DX11 in the build without the editor running.

If you have seen significant improvements, I would appreciate if you could share some details how exactly managed to achieve that and how your projects compare between DX11 and DX12 once you give it another go.

Unless the Unity 6 release is pushed back by a lot I don’t see any significant improvement coming, in my experience 6000.0.18f1 which was released less than a week ago barely runs any better than 2022.3 with DX12, especially when comparing play mode performance.

1 Like

Did you have a chance to check the profiler to identify where the regression is happening? Is it on the CPU, the GPU, or possibly both?

In September 2023, I reported a 30% performance degradation in URP14 / Unity 2022.3 (link) too, which has since been marked as “By Design” (link).

3 Likes

The very bad things about this is that Unity seems to see DX12 now as some sort of default. Some new features are implemented to only work with DX12 (happened so in the OpenXR package).

1 Like

Didn’t see this one, but I’m glad it’s not a bug and they just designed the performance drops :rofl:
From my experience the last few years, by the time Unity 9 rolls out, we’ll still be in this thread discussing this very same thing hoping the next version might make it better.

3 Likes

This is exactly what I am most concerned about, thanks for speaking up about it.

The performance budget is already heavily constrained for XR developers, we really can’t afford to lose half of it for no good reason.

I’m honestly scared that this is as good as it gets for DX12 and we will all just have to accept this new reality as support for DX11 from Unity und GPU manufacturers keeps waning. It’s strange to think that at some point in the future we will simply lose our current frame of reference, and the next generation of developers that start their career without DX11 will simply never know that they are working with barely half of what their graphics hardware is actually capable of.

I also find it kind of insane that most DX12 exclusive features like hardware dynamic resolution are just there to mitigate problems that did not exist without it. I tried upscaling from 65% resolution with STP just as was shown in the Unite 2023 demo, even with drastic measures like that which significantly degrade image quality the frametimes are still way higher than running the same scene at 100% resolution with DX11. I don’t even know what else to say about that, the only way I can explain that to myself is that I’m suddenly completely CPU limited in DX12 and the fundamental premise that DX12 shifts load to the GPU is just theoretical and in practice the exact opposite is the case in Unity’s implementation.

This actually goes beyond just the DX12 implementation and appears to be a pattern with the new GPU driven rendering approach, I was very confounded to find out GPU occlusion culling was implemented in a way that actually significantly increases draw calls, which makes it pointless for a lot of use cases like XR. It actually increases frametimes even in indoor scenes with lots of large occluders, even in that best-case scenario you are way better of just using Umbra if you have even a bit of memory to spare.

I would really appreciate some input from the Unity staff, please give us some indication on whether we should expect to work with half the performance budget in the future, and for just how much longer DX11 is going to be fully supported.

3 Likes

Hey! As it relates to Unity 2022, we usually recommend DX11. Hence it is set as “default”, meaning the first priority in the Auto Graphics API settings. Unity 6 introduces meaningful improvements to DX12 so I recommend giving it a try and sharing what you see.

There are good reasons to use DX12 besides Ray Tracing. Multithreading is a good example. Based on our tests, using internal benchmarks and actual game projects, Split Jobs (Unity 6) seem to be effective at reducing CPU latency, Both in the Editor and Player. There are other benefits, like async compute, Native Render Pass support (for ARM based devices) and PSO tracing to eliminate stutters.

If you see such a drastic regression in performance compared to DX11 also in Unity 6, please share more details! For the last question, a quick way to test would be to fetch the 3D sample projects from the Unity Hub (Create new project → Sample).

2 Likes

Thank you for the feedback! DirectX11 is still supported, and generally we aim to implement features on all graphics APIs that can reasonably support those. Of course, DX12 supports newer capabilities unavailable DX11, so newer features may not always support DX11. Ray tracing and multithreading are good example.

As of the current Unity 6 version (6000.0.18f1), DX11 is still set as the default graphics API (meaning it is the first priority in the Auto Graphics API setting). We hope to soon promote DX12 as default, but DX11 will ofc still be supported and accessible from the Player Settings in Unity 6.

Regarding this:

You can use the Rendering Debugger (Display Stats) and Profiler (as well as system/GPU profilers) to try and pinpoint whether your game is CPU or GPU bound. For example, in Unity’s Profiler, try looking for long “WaitForPresent” samples. See more here Unity - Manual: Profiler markers reference

2 Likes

Hi,

Please if DX12 is not on par or faster than DX11, focus on DX11 and have it as default.

The downgrade for now, from what i read above, sounds like massive if DX12 goes default.

1 Like

Here are my results for DX11 vs DX12 using BiRP in the editor.

Unity 2022.3.44 (LTS)

  • 1920x1080 DX11 43 FPS
  • 1920x1080 DX12 46 FPS +7%
  • 3840x2160 DX11 32 FPS
  • 3840x2160 DX12 32 FPS No Change

Unity 6000.0.18

  • 1920x1080 DX11 45 FPS
  • 1920x1080 DX12 43 FPS -4.5%
  • 3840x2160 DX11 32 FPS
  • 3840x2160 DX12 31 FPS -3%

Performance benchmarking in complex scenes is challenging because systems, including the GPU, tend to throttle down after sustained load. Until I accounted for thermals, I saw a 15% variability in frame rate.

Each scene and use case is different. In my test scenario, the differences were minimal and might fall within the margin of error.

I’ll rerun these tests after I finish optimization with billboards and grass.

3 Likes

Are these measured in builds or in editor? Also it’s always better to use GPU and CPU time for performance measurement instead of FPS.
Another issue many saw with DX12 is memory usage on GPU, which might be another important performance factor on bigger scenes.
I’ll also redo tests soon, last time was like 10 versions ago, maybe something changed (did not see anything related in change logs of Unity 6, though).

2 Likes

Editor.

The testing helps, IMO. Even if Unity doesn’t act on it or whatever, it can help developers predict problems and perhaps adjust tactics to compensate for known issues.

1 Like

Measuring fps in builds is very imprecise. In 2023.2.20 I get differences of like 10-20 fps on different runs without changing anything (DX11)
Edit: I meant in editor, of course.

1 Like

Are you accounting for thermals? Modern GPUs and CPUs throttle under sustained load. I saw a 15% variance during testing due to this reason. Perhaps you meant the editor?

Ah, sorry, I meant measuring in editor of course.

1 Like

These are some nice results, but this is not the reality for many others, including myself. I won’t repeat the details of my DX12 experience here again (further up I have lengthy posts), but the fact that some of us are getting half the frame rate and twice the memory consumption, is not simply something we did wrong or could fix easily. I’ve spent 100s of hours optimizing, rethinking tactics, etc. to reduce memory consumption and reduce frame time. It’s still far higher in DX12 compared to DX11.

But on this forum and in DM I’m talking to Unity people, and I’m still betting on U6 based on what they are saying. I will go through all the detailed comparisons again then, and report back.

EDIT: also noteworthy is that I’m on HDRP, which is a memory hungry beast compared to BIRP.

5 Likes

I had a brief run of HDRP + XR in Unity 6000.0.19 and DX12. Seems most obvious performance issues are much better, did not see bigger differences to DX11. But only used sample scene and no build yet, will jump into an in depth session once Unity 6 is released, which should be VERY soon.

3 Likes