Repository navigation
Commit b6b5746
committed
VR: Handle games whose frame number freezes or restarts
UEVR keys its pose pipeline on the frame number from the game's FSceneViewFamily: poses
live in pipeline_states[frame_count % QUEUE_SIZE], the game and render threads are
matched by it, and it reaches enqueue_render_poses.
OpenXR::on_pre_render_game_thread refreshes a slot only when it is empty or when the key
jumped forward past it. Any other revisit keeps the predicted display time already in the
slot, so xrLocateViews predicts for a moment that has passed and the image comes loose
from the head and swims against it. The game's number revisits slots out of order in at
least two measured ways: it freezes while a fullscreen menu is up though the game keeps
rendering, held for 159 view families in The Outer Worlds 2, and it restarts from scratch
on a level load, in Gylt and Silent Hill 2.
Carry the number onto a key that only moves forward: count on while it is frozen, and
step one past the highest reached when it restarts. An offset rather than a counter of
our own, so a game that does neither keeps its own numbering with the offset at zero.
Both publishers of a frame number add it; applying it in one leaves the two disagreeing
by the width of a stall, and a pose stored under one key is looked up under another.
Progress is "exceeded the highest number seen", not "differs from the previous one": a
game can push several view families per frame, so the previous number repeats or
alternates between calls. Equality against it either fires throughout ordinary play,
shifting the key a frame every frame, or almost never fires and hides a real stall. Gylt
and Silent Hill 2 repeat a number within a frame, The Outer Worlds 2 sends one per call,
so no single title predicts which. A restart is told from extra view families by size:
orders of magnitude against a few.
The stall is decided where the number is read, not precomputed where it is published, so
a game that stops running that path cannot leave a flag stuck at its last value. The
threshold is 250ms of time, because "produced no frame" and "produces frames more slowly
than we present" differ only in duration.
The same stall breaks the native stereo fix, which takes the left eye from the game's
backbuffer and the right from a scene capture UEVR drives. Behind a fullscreen menu the
game stops drawing the world into its backbuffer while the capture keeps rendering one,
so the right eye holds a frozen world while the left correctly holds the menu on black.
Take both eyes from the backbuffer while stalled, as the null scene capture branch
already does.
Log both stall edges with the key, and log the pattern the game submits, once each. The
game carries on rendering, so nothing else in the log changes when its number freezes.1 parent 4ee5c6b commit b6b5746
3 files changed
Lines changed: 158 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
553 | 572 | | |
554 | 573 | | |
555 | 574 | | |
| |||
1136 | 1155 | | |
1137 | 1156 | | |
1138 | 1157 | | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1139 | 1161 | | |
1140 | 1162 | | |
1141 | 1163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
187 | 199 | | |
188 | | - | |
| 200 | + | |
189 | 201 | | |
190 | 202 | | |
191 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2596 | 2596 | | |
2597 | 2597 | | |
2598 | 2598 | | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
2599 | 2605 | | |
2600 | 2606 | | |
2601 | 2607 | | |
| |||
3464 | 3470 | | |
3465 | 3471 | | |
3466 | 3472 | | |
3467 | | - | |
3468 | | - | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
3469 | 3585 | | |
3470 | 3586 | | |
3471 | 3587 | | |
| |||
3695 | 3811 | | |
3696 | 3812 | | |
3697 | 3813 | | |
3698 | | - | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
3699 | 3819 | | |
3700 | 3820 | | |
3701 | 3821 | | |
| |||
0 commit comments