Glossary
IOSurface
The IOKit object that represents a chunk of memory mappable by both CPU and GPU. Zero-copy on Apple Silicon's unified memory.
An IOSurface is the IOKit-level abstraction for a piece of memory that can be mapped by both the CPU and GPU simultaneously. Foundation of zero-copy media and graphics on macOS.
What an IOSurface provides:
- A CPU mapping (read/write via
IOSurfaceGetBaseAddress). - A GPU mapping referenced by Metal
MTLBuffer/MTLTextureobjects. - Hardware coherency between the two — writes from one side are visible to the other without manual flush calls.
- A reference-counted handle that can be passed between processes via XPC.
On Apple Silicon's unified memory, there is no "upload to GPU" step — an IOSurface is literally just DRAM both processors can address. On older Macs with discrete GPUs, the IOSurface infrastructure managed the upload, but the API stayed the same.
Common uses:
- Video frames (AVFoundation produces IOSurface-backed pixel buffers).
- Render targets (Metal automatically uses IOSurface under the hood for
MTLStorageModeShared). - Cross-process image sharing (Quick Look thumbnails, screenshot APIs).
See also: the Apple GPU article, and IOKit.