Skip to content

D3D12.X: show live FPS in the game window title - #516

Merged
Mavixot merged 1 commit into
ivall:mainfrom
Mavixot:present-fps-counter
Nov 24, 2026
Merged

Mavixot merged 1 commit into
ivall:mainfrom
Mavixot:present-fps-counter

Conversation

@Mavixot

@Mavixot Mavixot commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Displays live FPS in the top title bar of the XCL window, alongside shader compilation progress. Samples successful presents over at least one second using actual elapsed time, and reports zero during a stall. Related to #450's optional in-frame overlay.

What is in it

  • crates/xcl/src/hle/d3d12x/present.rs: reuse the window timer and presented-frame counter; three tests cover sampling intervals, irregular timing, stalls and recovery.

Tested

  • AMD Radeon RX 6600 (driver 32.0.21045.16010), Ryzen 5 3600, Windows 11 Pro build 26300, Rust 1.100.0; debug tests and release game runs.
  • On b86fba483e6a, workspace and release builds pass. All three FPS tests pass. Changed snippets pass rustfmt; git diff --check passes.
  • cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4: 673 passed, 3 failed, 41 ignored, 0 GPU SKIPPED lines; Windows Application Control blocked 2 additional targets (disasm_e2e, e2e).
  • Failures: placed_title_textures_share_vram_and_preserve_pixels (3D mip readback mismatch), then transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory (poisoned lock). The same failure chain was reproduced on unmodified main at 2b4bb43.
  • GTA VI 1.0.2.1: the running title bar showed 29.7 FPS while the activity log recorded 60 presents per two seconds. The counter remains visible during shader status updates.

Regression run
Both runs use scripts/smoke.ps1 -Seconds 60 on the same title. The baseline precedes main's texture-upload optimization (#486); these results check for regression and do not isolate counter overhead or establish a speedup from the counter.

Main (2997c9a):

xcl-smoke v1
commit: 2997c9aca6ebf4577fed34ebdb3cb0a77dd9ec21
gpu: AMD Radeon RX 6600
title: game_scarlett_master.exe
seconds: 60
exit: 0x0
frames shown: 789 (PresentX 789)
presents per 2 s (last 3): 39 39 39
device removals: 0
crashes: 0
peak commit: 15077 MB

PR head (b86fba483e6a, after pushing):

xcl-smoke v1
commit: b86fba483e6a6763261a9f461c391c0822ea3183
gpu: AMD Radeon RX 6600
title: game_scarlett_master.exe
seconds: 60
exit: 0x0
frames shown: 1190 (PresentX 1191)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15082 MB

Not tested

  • The full suite is not green on this adapter; the three GPU failures and the two Windows-blocked targets above remain unresolved. The PR stays a draft for that reason.
  • Other GPUs and titles, and data-dependent sample suites without configured XCL_SAMPLE_* inputs. The counter measures successful XCL presents, including repeated image content.

AI use

  • Codex (GPT-6 family; exact model variant was not supplied) implemented the counter and tests, ran validation, and prepared this description.

Sample successfully presented frames over at least one second using the existing window timer. Keep FPS visible alongside shader compilation progress and report zero when presentation stops. Cover irregular sampling, sample intervals, stalls and recovery with unit tests.
@Mavixot
Mavixot marked this pull request as ready for review November 24, 2026 01:14
@Mavixot
Mavixot merged commit 508a0c7 into ivall:main Nov 24, 2026
3 of 4 checks passed
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