Skip to content

Recording (Windows): stop reading back the GPU frame when WGC delivered nothing new #925

Description

@EtienneLescot

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststatus: fixed in mainWork is merged into main but may not be in a downloadable release yet.status: pending releaseMerged change is waiting for a packaged desktop release.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions