Encodes table index index as the RGBA colour its id draw writes: the
value index + 1 split into four bytes, little-endian, each scaled to
[0, 1] (RFC 0005 §3).
Byte k of the value goes to component k, so decodePickId over
the read-back bytes is exact: an 8-bit UNORM attachment stores b / 255
as precisely b.
Writes into out (4 floats) rather than allocating — the backend uploads
from one scratch per pass.
Encodes table index
indexas the RGBA colour its id draw writes: the valueindex + 1split into four bytes, little-endian, each scaled to[0, 1](RFC 0005 §3).Byte
kof the value goes to componentk, so decodePickId over the read-back bytes is exact: an 8-bit UNORM attachment storesb / 255as preciselyb.Writes into
out(4 floats) rather than allocating — the backend uploads from one scratch per pass.