How DLSS Ray Reconstruction Hooks into DirectX
This article provides a technical overview of how NVIDIA’s Deep Learning Super Sampling (DLSS) Ray Reconstruction integrates into the modern DirectX 12 rendering pipeline. It explores the shift from traditional hand-tuned denoisers to an AI-driven framework, identifying the exact insertion point where DLSS Ray Reconstruction intercepts ray-traced data, the DirectX resource inputs required, and how the underlying compute execution processes noisy samples into high-fidelity imagery.
In a conventional DirectX 12 Raytracing (DXR) pipeline, the engine
first generates standard rasterized geometric buffers (G-Buffers
containing depth, world normals, and motion vectors). Afterward, the
engine invokes DispatchRays to trace light paths across
several passes, typically dividing work into diffuse global
illumination, specular reflections, and shadows. Because casting
hundreds of rays per pixel is computationally prohibitive, the engine
traces a sparse number of rays (often 1 or 2 rays per pixel), generating
noisy intermediate radiance buffers. Traditionally, these buffers are
sent through multiple hand-tuned spatial and temporal denoiser passes
before being recombined and fed into a separate temporal upscaler.
DLSS Ray Reconstruction fundamentally alters this pipeline by replacing both the individual hand-tuned denoisers and the standard DLSS Super Resolution stage with a single, unified neural network.
To hook into DirectX 12, developers integrate DLSS Ray Reconstruction
using the NVIDIA Streamline framework or directly via the NVAPI library.
The hook operates at the compute shader stage of the DirectX pipeline.
Rather than allowing the engine to execute its native denoising passes,
the engine binds the raw, noisy radiance output buffers from the DXR
DispatchRays call directly as shader resource views (SRVs)
for the DLSS pipeline.
The integration requires the engine to supply several specific DirectX 12 resources to the DLSS interface:
- Noisy Radiance Buffers: Unfiltered hit results, separated into specular and diffuse components to preserve high-frequency lighting details.
- G-Buffer Data: High-precision geometric normals, surface roughness, and linear depth buffers.
- Motion Vectors: 2D screen-space vectors representing both camera motion and dynamic object movement.
- Ray Tracing Parameters: Ray hit distances and ray directions to help the model distinguish between surface geometry and reflected geometry.
Once these DirectX resources are bound, the integration dispatches a driver-level compute workload. Under the hood, this executes an autoencoder neural network directly on the GPU’s Tensor Cores. The model processes the temporal history alongside the raw DXR inputs, intelligently accumulating valid samples across time while identifying and rejecting ghosting artifacts.
Because the neural network is trained to recognize lighting patterns rather than simply blurring pixels, it simultaneously denoises and upscales the image. The DLSS Ray Reconstruction pass outputs a clean, super-resolved HDR radiance buffer into an unordered access view (UAV) or render target view (RTV). The engine then bypasses any further spatial or temporal denoising and proceeds directly to post-processing, tone mapping, and user interface compositing in the final stages of the DirectX frame.