Depth Pyramid visualization

Metal Single Pass Downsampler (SPD)

Introduction I’ll walk through my implementation of the Single Pass Downsampler (SPD) algorithm for Apple’s Metal API. SPD is an algorithm for generating mipmaps in a single compute shader pass, as the FidelityFX SPD by AMD. Full source code at the end of the post. What is a Single Pass Downsampler? Traditional mipmap generation requires multiple passes, where each mip level is computed in a separate dispatch with synchronization points between them. This means the GPU must wait for each level to complete, write results to device memory, and then read them back for the next. This results in both memory bandwidth costs and CPU-GPU synchronization overhead from multiple API calls. SPD eliminates this overhead by using threadgroup memory to keep intermediate downsampling results local to the compute threadgroup, allowing all mip levels to be generated without round trips to device memory. SPD can be generalized to be used for any texture, however I implemented it to generate a depth pyramid for occlusion culling. ...

February 9, 2026 · 9 min · 1739 words · Kiriakos Gavras