Commit Graph
6 Commits
Author SHA1 Message Date
Anees Iqbal 2cb33d2c89 🐎 Run decodes beside the copies out where layouts are unified
On the RTX 5080 the decode engine sat idle 10-24% of each stream's time
(measured: 104-280 us p50 between decodes against 406-1680 us of decode):
every decode waited for the copy out of the picture before it, on the
reserved queue, and so did the event's signal batch on the decode queue,
since a copy without unified layouts moves a DPB picture's layout that the
next decode reads.

Where the device has VK_KHR_unified_image_layouts' unifiedImageLayoutsVideo
(now an optional extension of the platform's device; the 5080's 615.71
driver has it) and the copies run on the reserved queue, a decode now waits
only for the last copy out of the image it writes, sets up the free slot
copied out of longest ago, in a session of one more slot where the device
has it, and the event's signal goes on the reserved queue behind the copy.
A decode's value is signalled by a batch of no work after it that also
waits for the copy before it, so the shared timeline is still signalled in
order when a decode ends before the copy before it.

Devices without the feature, or with copies on the decode queue or a lent
queue, keep the old order. Unit tests run the order on a fake GPU: overlap
leaves the decode queue no idle tick, and a decode signalling its own value
would put the timeline out of order.
2026-11-05 21:59:28 -08:00
Anees Iqbal 72a5fe6788 🐎 Copy decoded pictures out on a queue the runtime reserves
On a GPU of its own memory a decoded picture is copied into the runtime's
buffer that holds the surface's device cache, which only a queue of the
runtime's families reaches. Until now that was a runtime command queue's
VkQueue, lent per submission, which logical queues share with the guest's
work: a copy that waited for its decode on the GPU would hold that work
behind it, so a thread waited for each decode on the host and only then
submitted its copy.

metal2vulkan now reserves queues of its own families for the caller, which
none of its work ever runs on. The platform asks every device for one, and
the hardware video copies on it as on a queue of its own: each copy is
submitted with its decode and waits for it on the GPU, with no host
round trip between them. A device with no queue to spare (MoltenVK,
lavapipe, a Radeon's single graphics queue) reserves none, says so once at
info level, and keeps the lent queue and its host wait.

The options are one set for every device the process makes, so a device
with a queue to spare and no video-decode family reserves one it never
uses; on an RTX 5080's 16 graphics queues the round robin goes from 14 to
13.
2026-11-05 21:59:22 -08:00
Anees Iqbal e994560cf8 📝 Describe the Vulkan Video encoders and their check [ci skip]
The encoders need their contract written where the decoders' is: how a
device gets its encode queue, the RTX 5080's encode capabilities, where
sources and bitstreams lie and what is copied, how pictures, references
and rate control are planned, the NVIDIA 615.71.09 bugs worked around
and why, what the encode check checks, its results and GPU time a
picture at 1080p and 4K on the 5080, and what is not done.
2026-11-05 21:59:22 -08:00
Anees Iqbal 46c5860edc 📝 Describe the copies on a lent queue and their check [ci skip]
The video crate's doc names lent.rs and from_raw_copying_on, says why a
copy on a lent queue is submitted from a thread once the host sees its
decode done (a GPU wait there would hold the owner's work behind the
decode), and counts the H.264 check's two lent runs: all 68 of its
verdicts pass on the RTX 5080 Laptop GPU.
2026-11-05 21:59:22 -08:00
Anees Iqbal 58a661460f 📝 Describe the Vulkan H.265 decoder and its check [ci skip]
docs/video/vulkan.md now covers H.265 beside H.264: the 5080's H.265
answers, P010 pictures and buffer landings, each decode's plan (references
and their slots, the current sets, the 8-picture limit, IsReference), the
parameter sets as std structures, in-place reads, the GPU-less tests and the
check's 191 verdicts on the 5080.
2026-11-05 21:59:22 -08:00
Anees Iqbal 0021f9c41c 📝 Describe the Vulkan Video H.264 decoder [ci skip]
What the crate is and is not yet, the device it takes, its own DPB
pictures and the outputs it lands pictures in (images and buffer
planes), how the bitstream, parameters and frame numbers reach the driver,
including the shift past a frame number wrap that NVIDIA's initial lists
need, the timeline it signals, and what the H.264 check measured on the
RTX 5080.
2026-11-05 21:59:21 -08:00