DirectX 12 Work Graphs: Unlocking Your GPU’s Potential

Microsoft has unveiled a new feature for DirectX 12, dubbed Work Graphs, which has been available in a preview release for some time. Work Graphs aim to enhance the efficiency of GPU-driven rendering, thereby alleviating the computational load on the CPU.

In a blog post, Direct3D engineer Amar Patel and DirectX compiler engineer Tex Riddell elaborated on Work Graphs. This feature represents a GPU autonomous system within D3D12, designed to circumvent limitations on general computing workloads on GPUs and unlock potential GPU capabilities. In essence, this new system transitions to a more efficient GPU-driven rendering process, reducing the dependency on the CPU across various workloads.

DirectX 12 feature

In numerous GPU workloads, the initial computations on the GPU dictate subsequent tasks, traditionally completed by reverting to the CPU to issue new work orders. However, allowing the GPU to generate its work tasks and directly supply the necessary data proves to be more effective. D3D12’s ExecuteIndirect feature is an example of this approach, where the application records a highly restricted command buffer on the GPU, necessitating serial processing on the GPU to dispatch new tasks.

This introduces a novel paradigm where shader threads running on the GPU (producers) can request additional tasks (consumers), with the consumers also acting as producers, provided the GPU can manage the requested workload. Moreover, applications can entrust the system with overseeing the memory flow between tasks, enhancing overall efficiency and performance.