Files
reims-vgpu/docs/graphics-kext
Anees Iqbal 4abaf91c85 🐎 Fill a VideoToolbox encode's input surface on the GPU
An arm64 guest's VideoToolbox encoder read each source frame through the host's
view of the IOSurface's pages, and the VA crate's encoder uploaded it by the
CPU. The runtime device's GPU now copies the frame's two planes, in place, from
a Shared buffer over the surface's pages (LentViews::buffer_over, kept with the
session's view of the surface) into an input surface of the encoder's, as an
x86 guest's frames are filled (cee727b5e). Where the device makes no such
buffer, or the copy is declined, the frame is uploaded by the CPU as before,
said once a session; an input surface whose fill failed on the GPU stays out of
the encoder's pool.

What the guest sees: the same samples, byte for byte
(a_guest_encoders_frames_filled_by_the_gpu_code_as_read_by_the_cpu, on the
780M's radeonsi, m3-max-38046; in the boots below, the same bytes for each
stream), at a higher rate. A macOS 26.6.2 guest under TCG on the 780M, 120
frames at 1080p and 8 Mbit/s, two runs each: H.264 45.5 and 47.8 fps before,
49.6 and 49.0 after; HEVC 52.9 and 51.9 before, 57.9 and 57.2 after
(m3-max-38122, m3-max-38178). Each fill took 0.14 ms of GPU time.
2026-11-16 16:41:54 -08:00
..