%% how a DXGI colour space becomes a CAMetalLayer set-up on each present. The layer only changes its tags; no shader converts colour. flowchart LR A["SetColorSpace1
(or the format's default)"] --> B{"colour space"} B -- "G22 P709
(sRGB)" --> C["back buffer's format
sRGB colour space
no EDR"] B -- "G10 P709
(scRGB, FP16 only)" --> D["RGBA16Float
extended linear sRGB
EDR on"] B -- "G2084 P2020
(HDR10, RGB10A2 only)" --> E["RGB10A2
ITU-R 2100 PQ
EDR on"] F["SetHDRMetaData(HDR10)"] --> G["CAEDRMetadata HDR10
from H.265 SEI bytes"] G --> E C --> H["macOS compositor:
colour matching,
tone mapping to the
screen's headroom"] D --> H E --> H I["NSScreen EDR headroom
and P3 gamut"] --> J["GetDesc1: HDR10,
100 nits × headroom"]