Part of #920 (rank 7). Effort S to M, risk low.
Problem
- The video writer reads back the full GPU frame on every tick, even when WGC delivered no new frame (
main.cpp writer loop).
- Each readback is a
CopyResource followed by an immediate Map (a GPU stall), a new 8 MB buffer per frame and a row-by-row copy (mf_encoder.cpp).
- Estimate: about 475 MB/s per stage at 1080p60, about 2 GB/s at 4K60. On a static screen, all of it re-reads the same picture.
Proposal
- When no new WGC frame arrived, resubmit the last encoded sample instead of reading back again.
- Later, if needed: a ring of 2 to 3 staging textures and a buffer pool (one frame of latency, timestamps unchanged).
Verify
typeperf "\Process(wgc-capture)\% Processor Time" and the GPU engine counter over 60 s: static screen, scrolling text, full-screen video. Before and after.
[pacing] unchanged or better.
Part of #920 (rank 7). Effort S to M, risk low.
Problem
main.cppwriter loop).CopyResourcefollowed by an immediateMap(a GPU stall), a new 8 MB buffer per frame and a row-by-row copy (mf_encoder.cpp).Proposal
Verify
typeperf "\Process(wgc-capture)\% Processor Time"and the GPU engine counter over 60 s: static screen, scrolling text, full-screen video. Before and after.[pacing]unchanged or better.