Skip to content

Frame pacing groundwork: hardware flip queue probe and a two-route pacing test - #130

Draft
phantoslayer21 wants to merge 2 commits into
mainfrom
fg/hwfq-pacing-probe
Draft

phantoslayer21 wants to merge 2 commits into
mainfrom
fg/hwfq-pacing-probe

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Refs #96

Read-only groundwork for frame generation presentation and pacing. There are no product code changes, and no claim
here that frame generation works, how well it paces, or when it ships.

What this adds

  • clean/fg/hwfq_probe.cpp: asks the graphics kernel (documented D3DKMTEnumAdapters2 / D3DKMTQueryAdapterInfo
    queries) whether hardware GPU scheduling and the hardware flip queue are enabled per adapter. It creates no device.

  • clean/fg/fg_pacing_test.cpp: presents alternating "real" and "stand-in" frames (two low-contrast greys) at a fixed
    target interval through two public routes, and reports on-screen interval evenness (mean, sd, p99, misses) from each
    route's own statistics:

    • route A, the composition swapchain: SetTargetTime per present, Direct3D 11 displayable surfaces, and the
      PresentStatus / CompositionFrame / IndependentFlipFrame statistics;
    • route B, Direct3D 12 with a DXGI flip-model IDXGISwapChain4: FLIP_DISCARD, a frame-latency waitable object,
      Present(1, 0) and GetFrameStatistics.

    First it prints read-only context: the display mode and refresh period, the output's EDID identity, tearing support,
    the console display state, and DWM's completed frames over one second.

  • clean/fg/HWFQ-FINDINGS.md: what the test PC reports, the Microsoft documentation for the routes, what AMD's public
    frame generation manual states about its pacing, and the first runs. Every statement is a quotation or a printed
    value.

Both programs are our own code, written from Microsoft's public API documentation, with no third-party code. They are
not part of any build or CI job; build them by hand as the note describes.

Second commit: experiment with AMD's frame generation swap chain (test only)

  • clean/fg/fetch_ffx_sdk.py fetches the files the experiment needs from AMD's public FSR SDK into a folder OUTSIDE the
    repository. Source: github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, tag v2.4.0, commit
    7539ae8b6568ad29ed78a753404351daf3b5cca7. The files are the API headers, the signed loader and frame generation
    DLLs, and the licence. Each file is checked against the commit's git blob hash, and a SHA-256 manifest is written.
    No SDK file (header, DLL, licence) is in this pull request.
  • clean/fg/ffx_swapchain_test.cpp creates the frame generation swap chain and the frame generation context through
    the documented API, and supplies our stand-in frame through frameGenerationCallback. AMD's own interpolation is
    never dispatched. It reports:
    • return codes and callback counts;
    • the GPU memory of the idle context, from the API's queries and DXGI;
    • on-screen intervals from the swap chain's frame statistics;
    • observable signs of the pacing path: runtime messages, process CPU time, and the busiest threads with their
      priorities.
  • It is built and compiles without warnings (/W4). It has not run yet: it needs a live monitor, like the other runs.
    Its results and the reruns of fg_pacing_test will come as a second push.
  • Measured runs will use normal process priority, only inside their GPU slots, so that the swap chain's own
    high-priority pacing thread and the driver-assisted path compete fairly. Builds, fetches and records run at
    below-normal priority.
  • Shipping any AMD binary is not part of this pull request, and not decided.

Record (one test PC: Radeon RX 9070 XT, Windows 10.0.26200.9974 / 25H2, driver 32.0.32015.7029, WDDM 3.2)

  • hwfq_probe: "HwFlipQueueSupportState 2 (STABLE), HwFlipQueueEnabled 1" and "HwSchSupportState 2 (STABLE),
    HwSchEnabled 1" for the RX 9070 XT.
  • fg_pacing_test: built and run, 13 runs of 5 s, each in its own locked GPU slot, every one exit 0. No run produced an
    on-screen interval, so this PR gives no interval numbers:
    • route A: "IsPresentationSupported 1, IsPresentationSupportedWithIndependentFlip 1", "DisplayableTexture 1". Then
      "statistics received: independent-flip 0, composition-frame 0, present-status 300": per present, "skipped" x2 and
      "queued" x1 per composition frame (199 or 200 skipped of 300). Statistics for successive composition frames
      arrived about 77 to 80 ms apart.
    • route B: GetFrameStatistics returned S_OK with PresentCount 0, SyncRefreshCount 0 and SyncQPCTime 0 on every
      call ("no statistic 300").
    • Display, read only: QueryDisplayConfig gave "EDID ids valid 0, manufacturer 0x0000 product 0x0000" (DisplayPort);
      dxdiag listed no monitor name or model; DWM completed 8 to 11 frames a second.
    • Our reading, inferred, not proven: no live monitor was attached (the DisplayPort monitor was off or asleep).
      Without scanout VSync there are no display times to measure. Nothing was changed to find out.
  • The runs used the program as committed here, except two later changes: the per-present debug lines now print only
    with --verbose, and the usage text was extended. Both programs build with /W4 and no warnings (MSVC, x64).

Tested

  • Both programs build (MSVC x64, /W4, no warnings) and run to exit 0 on the test PC.
  • hwfq_probe output as above. fg_pacing_test: route A and B, windowed and borderless; route A also with QPC
    versus interrupt-time targets and with ForceVSyncInterrupt(true).
  • Leak scan: 0 hits on the three files. Public gates: the must-pass gates pass; the LOOK lines are the known baseline
    and none of them is in clean/fg/.

Not tested

  • On-screen frame-to-frame evenness (mean, sd, p99, misses) for either route. It needs a live monitor (or a display
    emulator with an EDID). The same short runs will be repeated then, and their numbers added here with their records.
  • Variable refresh behaviour: no public API reports whether VRR is active on an output. The program prints what can be
    read: tearing support and the user's DirectX graphics preferences.
  • Any frame generation code: that is a later step.

…cing test

Refs #96. Read-only groundwork for frame generation presentation; no product code changes.

- clean/fg/hwfq_probe.cpp asks the graphics kernel, through the documented
  D3DKMTQueryAdapterInfo queries, whether hardware GPU scheduling and the
  hardware flip queue are enabled for each adapter. It creates no device.
- clean/fg/fg_pacing_test.cpp presents alternating "real" and "stand-in"
  frames at a fixed target interval through two public routes and reports how
  evenly they reach the screen from each route's own statistics: the
  composition swapchain with SetTargetTime (route A, Direct3D 11 displayable
  surfaces) and a DXGI flip-model swap chain on Direct3D 12 with a frame-latency
  waitable object (route B). It first prints read-only display context.
- clean/fg/HWFQ-FINDINGS.md: what the test PC reports, what Microsoft's
  documentation says the routes need, what AMD's public frame generation
  documentation states about its pacing, and the first runs. Those runs gave no
  on-screen times, because no live monitor was attached; no interval figures
  are reported yet.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…tand-in frame

Refs #96. Test only; nothing from AMD's SDK is added to the repository or shipped.

- clean/fg/fetch_ffx_sdk.py fetches the few files the experiment needs from
  AMD's public FSR SDK at one pinned commit (tag v2.4.0) into a folder outside
  the repository: the API headers, the signed loader and frame generation DLLs,
  and the licence. Each file is checked against the commit's git blob hash, and
  a SHA-256 manifest is written.
- clean/fg/ffx_swapchain_test.cpp creates the frame generation swap chain and
  the frame generation context through the documented API, and supplies our
  stand-in frame through frameGenerationCallback. AMD's own interpolation is
  never dispatched. It reports return codes and callback counts, the GPU memory
  of the idle context, on-screen intervals from the swap chain's frame
  statistics, and observable signs of the pacing path (runtime messages,
  process CPU time, busiest threads and their priorities). A --dwm-check mode
  reports DWM's completed frames per second, read only.
- HWFQ-FINDINGS.md: how to fetch, build and run it. No results yet; they need a
  live monitor.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21 phantoslayer21 added this to the 0.7.0 milestone Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant