Metal 2 on A11 — Imageblock Sample Coverage Control

WWDC 2018

Posted by Den on October 02, 2018 · 5 mins read
Metal 2 on A11 — Imageblock Sample Coverage Control

Metal 2 on A11 — Imageblock Sample Coverage Control

Tech Talks

TechMetal 2 on A11 — Imageblock Sample Coverage Control

Tech Talks

Multisampling Antialiasing

MSAA on A-Series GPUs

  • Edge tracking built into hardware for fast blending
  • Efficient memory usage with Memoryless Render Targets
  • Optimize memory bandwidth with resolve store action
  • Programmable Sample Positions introduced in Metal 2

Enhanced MSAA on A11

  • Faster MSAA hardware
    - A11 GPU tracks unique sample data for even faster blending
  • Imageblock Sample Coverage Control
    - Access sample coverage tracking data
    - Resolve at any time in your render pass
    - Implement custom resolve with tile shading

Edge Tracking

  • A-series GPUs track primitive edges
    -
    Pixels without edges blend per pixel
    - Pixels that contain edges blend each sample
  • A11 GPU also tracks unique samples
    - Pixels that contain edges blend unique samples

Enhanced MSAA on A11

Optimized multisampled blending

  • GPU tracks unique colors per pixel
  • Primitives can add or merge colors
  • Only blend unique values
    - Includes programmable blending

Color Tracking Example

  • Initial Value
    -
    All samples are initialized to a clear color
    - 1 color represents all 4 samples
  • New unique color introduced
    - Primitive edge can introduce a new color
    - Covered samples are reassigned to the new color
  • Blend each unique color
    - Blend for each covered color
    - New unique colors created as needed
  • Merging colors
    - Color count can grow and shrink
    - Opaque geometry can merge colors

Imageblock Sample Coverage Control

  • Implement new algorithms and optimizations
Custom resolve with tile shading
  • Resolve in the middle of a render pass
    - Resolve sampels before blending
    - Ensure only 1 unique color to blend per pixel

Sample Code — Surface Aggregation

  • Merge surfaces heuristically
  • Do more in a single render pass
    - Render G-buffer with MSAA
    - Reduce unique G-buffer samples with tile pipeline
    - Light and shade aggregate G-buffer samples