Why is DX12 so much slower than DX11?

For my project, DX12 seems to be much much slower than DX11. Any clue as to what would cause this?

DX12:

DX11:

1 Like

Bump. It extremely slow for me aswell, in many scenarios. Even if raytracing mark is turned off it’s pretty much 30% slower than DX11 out of the box. On more complicated scenes with a lot of object performance is even worse, it can be even to 70% slower than DX11 or Vulcan.

2 Likes

^ this is still the case in 2019.4, its kind of crazy how much slower it is. I thought one of the big perks of DX12/Vulkan were jobified render queue, but even with my ryzen 9 it just seems slower on DX12.

I think Unity 2020.2 has some D3D12 performance improvements - I’m curious what sort of difference it would have in your tests.

@slime73 I’ll check it out. But I doubt there will be significant improvement. I’m testing DX12 since Raytracing introduction in HDRP and nothing has changed yet, but I’ll look into 2020.2a

Are you using Graphics Jobs?
It’s an option in the player settings.

yes

1 Like

What is graphics jobs? I read the page on it: https://docs.unity3d.com/ScriptReference/PlayerSettings-graphicsJobs.html

Has so little information… aren’t GPUs already massively parallel why do we need to enable it for it to do ?

The CPU must schedule work for the GPU to do. Traditionally, your game engine will have one thread called the “render thread,” which handles scheduling work for the GPU to do (which the GPU will then do in parallel). Recently, game engines have had multiple “render threads” which will all try to schedule work for the GPU to do at the same time, this is only possible because the graphics APIs (dx12/vulkan/etc) have recently made their APIs thread-safe. Unity’s Graphics Jobs, from the sound of the name, are probably using their Job System internally to schedule things from the CPU to the GPU in parallel. In theory, this should lift a huge bottleneck for a lot of Unity games, since pure draw calls is often the biggest issue with rendering in Unity.

6 Likes

Yes, same with my project.
https://discussions.unity.com/t/756071 page-2#post-5616073

1 Like

Will this mean the game is restricted to DX 12 users and latest Vulkan ?

what??

Well you said it uses the graphics api dx12 / vulkan that they made thread safe…

So i am asking if i use graphics jobs, would it mean my game is only compatible with dx12/vulkan compatible hardware… aka would phones/tablets be unable to use it?

If you run on a platform that does not support graphics jobs, we simply run with them disabled.

2 Likes

Ah okay thanks. Is there any reason its off by default instead of on by default if it auto disables anyway?

It had been “Experimental” for quite a long time because it had some known bugs that we needed to fix. However, it is on by default in more recent versions of Unity, because the bugs are now fixed (maybe 2020.x … I can’t remember exactly when we flipped the switch)

iirc it’s on by default since 2019.3 (in which it went out of experimental) but if you upgraded your project from an older version with it disabled, I think it will stay disabled because the setting is serialized and/or the project upgrade errs on the side of caution.

1 Like

Are there plans atm to improve DX12 performance? Is this on the radar? Or is focus more on Vulkan? I’ve personally feel like I’ve been waiting for years for some of the better features from DX12/Vulkan to make it into Unity (instant compute shader data readback, graphics jobs really replacing the render thread, stuff like that)

1 Like

Hi! We tried to upgrade our project to HDRP recently to check out the DXR posibilities. There’s a huge performance hit, first after going for DX12 API and second after turning Realtime Raytracing (Preview) check on (Even without any RT effect on the screen).

I made some benchmarks to check the results. Visualization scenes are heavy, we are always trying to hit 30fps on new turing cards in Build so there’s a lot of draw calls, it scales pretty well in DX11. DX12 from the other hand doesn’t, lack of performance hits interior scenes aswell. We are running on 2020.2.0a15 HDRP 8.1 but it doesn’t metter because we had the same problems in previous versions with previous HDRP.

I made benchmarks for our static scene, no animations, numbers are frames per second. FPS is stable so it’s pretty much avarage. There are only Lit and LayeredLit shaders in the scene. HEAVY stands for performance heavy scene, a lot of buildings with tons of foliage.

Large version with all the profilers:

As you can see the difference is pretty massive. Vulcan from the other hand works very well, but there’s no raytracing currently so that’s not suitable for us. I tried with graphics job turned on and off but it doesn’t seem to make a difference.

I also have my own interior project with the same performance issues. Any ideas?

7 Likes

Is there is simple API call to check current jobs state from C# ?