Sampler Feedback Min-Maps in DirectX Explained
Sampler feedback min-maps are a specialized Direct3D 12 Ultimate feature designed to record exactly which texture regions and mipmap levels the GPU accesses during rendering. By writing the minimum (most detailed) sampled mip level into a low-resolution feedback texture, developers obtain precise, hardware-driven telemetry about texture usage. This article explains how sampler feedback min-maps work and how they eliminate texture over-fetching, optimize memory consumption, and streamline GPU streaming pipelines.
Understanding Sampler Feedback and Min-Maps
In traditional rendering pipelines, the CPU makes educated guesses about which mipmap levels an object needs based on heuristics like camera distance, bounding boxes, or screen coverage. These estimates are often imprecise because they cannot account for real-time GPU-side conditions such as dynamic occlusions, complex shader arithmetic, or oblique surface angles.
Sampler feedback introduces hardware support for capturing texture access patterns directly from the graphics pipeline. A min-map (or Minification / Min-LOD feedback map) is a low-resolution resource paired with a source texture. When a pixel or compute shader samples the source texture, the GPU automatically records the lowest (most detailed) mip level requested in the corresponding region of the min-map. Because it records the minimum numerical value (where mip 0 is the highest resolution), the min-map always reflects the highest level of detail required by any visible pixel in that region.
The Problem of Texture Over-Fetching
Texture over-fetching occurs when a rendering engine loads more texture data into video memory (VRAM) than the GPU actually samples. This inefficiency typically manifests in two ways:
- Spatial Over-Fetching: An entire texture or high-resolution mip level is streamed into memory, even if only a small fraction of the surface is currently visible on screen.
- Resolution Over-Fetching: A higher-detail mip level is loaded based on bounding-box proximity, but screen-space factors, anisotropic filtering angles, or surface orientations mean the GPU only ever requests lower-detail mips.
Over-fetching degrades performance by saturating PCIe and storage bandwidth, inflating VRAM footprints, and causing frame stutters or visible texture pop-in when resource transfers queue up.
How Min-Maps Prevent Over-Fetching
Sampler feedback min-maps act as a ground-truth feedback loop between the GPU and the streaming system, resolving over-fetching through several mechanisms:
1. Hardware-Accurate Demand Tracking
Rather than relying on CPU estimations, the engine queries the min-map generated by the GPU during actual rasterization. If an object is partially occluded by another model, the occluded portions will not execute pixel shaders, leaving those regions unrecorded in the min-map. As a result, the engine streams only the surface regions that actively impact the final image.
2. Granular Tiled Resource Loading
Sampler feedback is commonly paired with DirectX 12 Reserved Resources (tiled textures). Min-maps expose usage at a configurable sub-resource granularity (such as 16x16, 32x32, or 64x64 texel blocks). By reading the min-map, the streaming system identifies the exact physical tiles required at each mip level and binds memory only to those active tiles, leaving non-visible tiles unmapped.
3. Elimination of Redundant Mip Streaming
Because the min-map stores the minimum mip index, the asset loader knows precisely when a higher-resolution mip is unnecessary. For example, if a texture's min-map indicates that mip level 2 is the most detailed level sampled across an entire surface, the engine avoids requesting mip levels 1 and 0 from disk. This drastically limits read requests to the exact resolution required for the current camera viewpoint.
4. Asynchronous, Stall-Free Readback
Generating feedback data incurs minimal GPU overhead because it writes directly to the feedback resource during standard sampler calls without stalling the pipeline. The CPU reads this feedback asynchronously across frames, creating a stable, continuous streaming budget that prevents bandwidth spikes.
By replacing conservative heuristics with exact GPU sampling data, sampler feedback min-maps ensure that memory and I/O pipelines transfer only the texture data that actively contributes to rendered frames.