From 84faeb1bf1fdf0fa271387e3d4799a84773c93a6 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 10 Aug 2026 12:39:46 +0200 Subject: [PATCH] =?UTF-8?q?docs(pf-encode):=20Linux=20Main10=20is=20live?= =?UTF-8?q?=20=E2=80=94=20the=20'inert=20until=20Phase=205.1'=20comment=20?= =?UTF-8?q?outlived=20the=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bit_depth field said '8 on Linux until Phase 5.1 lands a P010 capture path'. The code outran it: the gamescope HDR capture patches offer 10-bit BT.2020/PQ, nvenc_fmt maps X2Rgb10/X2Bgr10 to ARGB10/ABGR10, and is_ten_bit_input flips bit_depth and hdr from the negotiated input. Verified on home-nobara-1: 'resolved session plan ... bit_depth: 10, hdr: true' on the direct backend. A 10-bit frame deliberately takes neither the NV12 nor the YUV444 convert (both compute CSCs write 8-bit planes) and rides packed RGB to the encoder, which does its own BT.2020 CSC — pf-capture/src/linux/pipewire.rs owns that gate. So Main10 needed no P010 path to arrive, and P010 is now a perf follow-up (skip NVENC's internal CSC, as NV12 does for SDR), not the thing that makes 10-bit work. --- crates/pf-encode/src/enc/linux/nvenc_cuda.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs index da6c5cf9..25bb1cc1 100644 --- a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs +++ b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs @@ -747,8 +747,15 @@ pub struct NvencCudaEncoder { fps: u32, bitrate_bps: u64, buffer_fmt: nv::NV_ENC_BUFFER_FORMAT, - /// Encoded bit depth (8 on Linux until Phase 5.1 lands a P010 capture path). Kept for parity with - /// the Windows Main10 config, which is ported but inert until a 10-bit input exists. + /// Encoded bit depth. **10 is live on Linux** — this used to say "8 until Phase 5.1 lands a P010 + /// capture path", which the code has since outrun: the gamescope HDR capture patches offer + /// 10-bit BT.2020/PQ formats, `nvenc_fmt` maps `X2Rgb10`/`X2Bgr10` to `ARGB10`/`ABGR10`, and + /// [`is_ten_bit_input`] flips this field and `hdr` from the negotiated input. A 10-bit frame + /// deliberately takes NEITHER the NV12 nor the YUV444 convert (both compute CSCs write 8-bit + /// planes) and rides packed RGB to the encoder, which does its own BT.2020 CSC — + /// `pf-capture/src/linux/pipewire.rs` owns that gate. So Main10 needed no P010 path to arrive. + /// P010 remains worth having later purely as a perf win (pre-convert so NVENC skips its internal + /// RGB→YUV CSC, as NV12 already does for SDR) — it is not what makes 10-bit work. bit_depth: u8, /// Full-chroma 4:4:4 (HEVC Range Extensions) — set when the capturer delivers a planar-YUV444 /// `DeviceBuffer` on an HEVC session and the GPU supports YUV444 encode.