Direct3D* 12 Overview Part 7: Dynamic Heaps

By Michael J Coppock,

Published:08/27/2014   Last Updated:08/27/2014

In Part 6 we discussed how Command Lists allow for effective multithreaded rendering in Microsoft Direct3D* (D3D) 12. Multiple threads can generate command lists in parallel then submit them to the Command queue for serial execution on the GPU. Now we move on to Dynamic heaps.

As discussed earlier the game has control of resource renaming in order to make command generation parallel.  Additionally resource renaming has been made easier in D3D 12. If you look at D3D 11 it has typed buffers, you have either a vertex, constant or index buffer. A request often made of the D3D development team by game developers is the ability to use that reserved memory however they wish. That is exactly what they did, for D3D 12 buffers are no longer typed. It is just a chunk of memory  that the game can allocate as needed, in the size required, for the frame (or multiple frames). You can even allocate a heap allocator and subdivide as necessary, creating a more efficient process.  D3D 12 also has a standard alignment, as long as the game uses this standard alignment all GPUs will be able to read the data. As we all know the more standardized we can make things in the realm of PCs the easier it is to create content that works well across the many variations of CPUs, GPUs and other hardware. The memory is also persistently mapped meaning the address is always known to the CPU. Allowing for more CPU parallelism as you can have a thread point the CPU to that memory and have the CPU figure out what data is required for the frame. A task that can be parallelized by the game for more efficient rendering.

D3D 12 Dynamic Heaps

The top of the diagram above is the D3D 11 style with typed buffers. Underneath is the new D3D 12 model with a heap controlled by the game. Instead of each typed buffer being in a different location of memory we see a single piece of persistence memory. Whose buffer sizes are adjusted by the game based on the rendering needs of the current or even several frames.

 

Next up in Part 8: CPU Parallelism

 

Diagrams and code samples from BUILD 2014 presentation. Created by Max McMullen, D3D Development Lead at Microsoft.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804