Skip to content

D3D12.X: with XCL_LOOK_STATS=2 split a present's time on the submitter - #1

Merged
thisguyStan merged 1 commit into
devfrom
d3d12x/presentx-timers
Nov 28, 2026
Merged

thisguyStan merged 1 commit into
devfrom
d3d12x/presentx-timers

Conversation

@thisguyStan

Copy link
Copy Markdown
Owner

On a 16 GB NVIDIA card in the world, presents took 93 % of the submitting thread's time (xcl-dev#2688), but a present was one entry with only its wait for the copy of the frame before apart, so where that time goes could not be told.

Four more entries, timed with XCL_LOOK_STATS=2 only, as that wait is:

  • the wait for the present before it (PresentX's lock, the presenter's),
  • the copy (or composite) of the frame recorded and submitted, from the allocator's reset to its Signal,
  • the swap chain's Present, which DXGI holds while the frames before it are queued (a GPU-bound frame waits there),
  • the wait for a frame dump's copy (XCL_FRAME_DUMP, XCL_DUMP_TARGETS), up to 2 s each.

With XCL_ACTIVITY they appear in "calls of the submitting thread (2 s)" next to "presents"; what a present spends besides them is the rest (the plane checks, the frame-rate line, the device-removal check). No change with the switch off.

When the fallback presents on a submission (a title that does not call PresentX), its parts are timed inside ExecuteCommandLists rather than inside presents, as the copy wait already was.

They are sub-calls (is_sub_call, xcl-dev#2729), as the copy wait is, so the line's "completed" total counts each present once.

What is in it

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release:
  • cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)

Regression run

main:

PR:

Not tested

AI use

  • none / tool and model, and what it did

On a 16 GB NVIDIA card in the world, presents took 93 % of the
submitting thread's time (xcl-dev#2688), but a present was one entry with only
its wait for the copy of the frame before apart, so where that time
goes could not be told.

Four more entries, timed with XCL_LOOK_STATS=2 only, as that wait is:
- the wait for the present before it (PresentX's lock, the presenter's),
- the copy (or composite) of the frame recorded and submitted, from the
  allocator's reset to its Signal,
- the swap chain's Present, which DXGI holds while the frames before it
  are queued (a GPU-bound frame waits there),
- the wait for a frame dump's copy (XCL_FRAME_DUMP, XCL_DUMP_TARGETS),
  up to 2 s each.

With XCL_ACTIVITY they appear in "calls of the submitting thread (2 s)"
next to "presents"; what a present spends besides them is the rest
(the plane checks, the frame-rate line, the device-removal check). No
change with the switch off.

When the fallback presents on a submission (a title that does not call
PresentX), its parts are timed inside ExecuteCommandLists rather than
inside presents, as the copy wait already was.

They are sub-calls (is_sub_call, xcl-dev#2729), as the copy wait is, so the
line's "completed" total counts each present once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thisguyStan
thisguyStan force-pushed the d3d12x/presentx-timers branch from c726229 to 80e2ee4 Compare November 28, 2026 21:37
@thisguyStan
thisguyStan merged commit 07ddf19 into dev Nov 28, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant