fix(client): the probe now accounts for every bit it prints
First hardware run of --probe-decode, on the RTX 5070 Ti:
driver decode ops: H.264, H.265, AV1 (0xF)
Three names, four bits. 0xF is H.264|H.265|AV1|VP9 — bit 3 is
VK_VIDEO_CODEC_OPERATION_DECODE_VP9_BIT_KHR, a real decode operation this
client has no rung for, so the name table stopped short of it and the line
looked complete while silently dropping a codec the driver had advertised.
That is the exact failure this flag exists to prevent. The whole point of
--probe-decode is that a reader can trust the words to cover the number; a mask
with an unexplained bit asks them to trust it instead. VP9 is now named (marked
as having no punktfunk rung, because advertising it as decodable would be its
own lie), and any bit beyond the four we know prints as "unrecognised bits
0x…" rather than vanishing — so the next codec Khronos adds shows up as an
unknown rather than as nothing at all.
Gates: fmt clean; clippy -D warnings on punktfunk-client-session.
This commit is contained in:
@@ -561,11 +561,29 @@ mod session_main {
|
||||
" vulkan video decode: {}",
|
||||
if a.usable { "YES" } else { "no" }
|
||||
);
|
||||
let codecs: Vec<&str> = [(0x1u32, "H.264"), (0x2, "H.265"), (0x4, "AV1")]
|
||||
// Name every bit, and ACCOUNT for the ones we cannot name. The
|
||||
// 5070 Ti reports 0xF — four bits — while punktfunk decodes three
|
||||
// codecs, so the first version of this line printed three names
|
||||
// beside a four-bit mask and looked complete. VP9 (bit 3) is a
|
||||
// real decode operation this client has no rung for; a codec the
|
||||
// tool cannot name must not silently vanish from a mask it prints,
|
||||
// or the reader is left to trust that the words cover the number.
|
||||
const OPS: [(u32, &str); 4] = [
|
||||
(0x1, "H.264"),
|
||||
(0x2, "H.265"),
|
||||
(0x4, "AV1"),
|
||||
(0x8, "VP9 (no punktfunk rung)"),
|
||||
];
|
||||
let mut codecs: Vec<String> = OPS
|
||||
.iter()
|
||||
.filter(|(bit, _)| a.codec_ops & bit != 0)
|
||||
.map(|(_, n)| *n)
|
||||
.map(|(_, n)| (*n).to_string())
|
||||
.collect();
|
||||
let named: u32 = OPS.iter().map(|(b, _)| b).sum();
|
||||
let unknown = a.codec_ops & !named;
|
||||
if unknown != 0 {
|
||||
codecs.push(format!("unrecognised bits 0x{unknown:X}"));
|
||||
}
|
||||
println!(
|
||||
" driver decode ops: {}",
|
||||
if codecs.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user