DX12 – Multi-Threading Shadow Map Rendering Performance Boost, Can Be Applied to Existing Engines


At this year’s GDC, Kuba Cupisz and Kasper Engelstoft, graphics programmers at Unity Technologies, talked about Unity 5 and DX12. Now we all know that DX12 is going to be big, however we don’t know how developers will take advantage of it. Well, according to Unity’s programmers, DX12 can be used for multi-threading shadow map rendering as it can significantly boost performance and can be applied in all existing engines.

As Unity’s programmers said during their GDC 2015 presentation:

“We chose the multithreading of shadow maps as our first case study, because this is this is something that can be applied to your existing engine and you can get a nice performance boost from multithreading and using D3D12.”

Unity’s programmers then listed the reasons why DX12 can boost performance on rendering multi-threading shadow maps.

1) They are rendering before the main scene, which means commands can be generated in parallel with the main scene.
2) Rendering shadow maps is pretty much a) SetRenderTarget(shadowMap); b) render everything; with fewer state changes than normal scene rendering.
3) The extraction of casters & receivers is a very good thing to *not* do on the main thread.
4) That means that it can run in parallel with the whole rendering, and only needing the wait at the end of the frame.

In order to showcase the benefits of DX12 rendering multi-threading shadow maps, Unity’s programmers presented a test scene consisted of 7000 objects that were lit with 3 shadowcasting directional lights.

In DX11, the RenderShadowMaps samples were inlined on the main thread with the rest of the scene, and the CPU time spent rendering one frame is 23.38ms.

In DX12, however, the RenderShadowMaps samples were properly multi-threaded and the total frame time has dropped to 13.75ms.

All in all, DX12 promises to boost performance in major areas. Games that rely heavily on shadows will undoubtedly benefit from it, and as Unity’s programmers noted this can be applied to most existing engines.

Those interested can view this entire GDC 2015 presentation here.