framepace

An Xbox Series title's own x86-64 code, run natively on a Windows PC, and measured frame by frame on one machine.

Scroll: the panel stays where it is and shows what each step is about, from real logs of that machine.

CPURyzen 7 5800X
GPURTX 4060 Ti 8 GB
RAM32 GB
How it runs

No emulator. The game's code runs on the PC's CPU.

The title's executable is loaded and its imports are bound to Rust versions of the console's libraries. Its D3D12.X calls become PC Direct3D 12, and its RDNA2 shaders are translated to DXIL when the game creates them.

DLSS or FSR 3 bring the picture up to the screen, with frame generation on top. Nothing from the game is in the repository: everything is built from your own dump.

Walking

On foot the frames come evenly.

The graph is the longest frame of each second, since a hitch is one long frame and an average hides it. Walking, it stays between 50 and 70 ms.

The layer is CPU-bound: about 33 ms of CPU work per rendered frame.

~22rendered fps, median
50โ€“70 mslongest frame a second
Driving

Driving, the world streams in and frames pass 100 ms.

The red bars are seconds with a frame over 100 ms. In those seconds the threads that refresh copies of game memory take 21 ms instead of 12, and about a fifth of them also compile a shader.

16โ€“20rendered fps driving
0seconds over 100 ms in this log
The 8 GB card

Late in a run the textures outgrow the card.

Textures the shaders pick by index are almost never let go, so the card's memory climbs past what Windows grants the game. Windows then pages memory between the card and the PC while frames wait.

Other programs hold card memory too: the desktop, Discord and the browser, about 1.3 GB together.

7.9 / 7.0 GBin use / budget
21 โ†’ 16rendered fps once over
Frame generation

Frame generation 2x doubles what you see, not what the game does.

One frame is made between every two rendered ones. The picture is smoother; input still follows the rendered rate. With about 20 rendered frames a second, 2x is the setting this project measures against.

~22rendered a second
~44shown a second with 2x
Now on trial

New texture blocks go to the PC's 32 GB once the card is full.

With VICTORY_TEXTURES_TO_PC=1, a new 64 MB block of textures is made in the PC's memory from 97 % of the card's budget. The card reads it over PCIe, which is slower, but nothing gets paged back and forth mid-frame.

Framepace.cmd alternates it on and off at each start, and Framepace.cmd -Compare tells which held up. Not measured yet.

Start

  1. Install Rust and the Visual Studio Build Tools with Desktop development with C++.
  2. Build with Build-Native.cmd; it writes framepace.exe.
  3. Copy it next to game_scarlett_master.exe in your own dump.
  4. Run Setup-MyRig.cmd once, then play with Framepace.cmd.

The first start of a new build compiles the shaders, about ten minutes on this PC. Later starts reuse the cache.

Check it

cargo test --workspace --locked   # no game, no GPU
cargo xtask policy                # nothing from the game
Framepace.cmd -Check              # settings, without starting
Framepace.cmd -Compare            # the A/B runs side by side

In the game, F1 opens the settings and F3 the live statistics. The frame counter keeps rendered and generated frames apart.