Make it easy to add a new protocol to the list without duplicating logic. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22682>