victory-gpu: [display] fps_limit and F11/Alt+Enter borderless toggle #773

Open
Revens2 wants to merge 1 commit from upstream-pr/773 into main
Revens2 commented 2026-11-25 07:13:48 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:13:48Z.


Refs #727 (window mode, fps limit) and #728 (phase 0, measurement). Does not close either.

What is in it

  • [display] fps_limit in victory.toml (env VICTORY_FPS_LIMIT, 0 = off, at most 1000). Applied just before Present: sleep until 1.5 ms before the deadline, then spin. A late frame is not made up for (no burst after a slow frame). The title's own frame clock (frame.rs) is untouched.
  • [display] window_mode = "windowed" | "borderless" (env VICTORY_WINDOW_MODE) and F11 / Alt+Enter at run time, on the window victory-gpu creates. Borderless is a popup over the monitor the window is on (flip model, no exclusive fullscreen); the swap chain keeps the title's size and is stretched, so another aspect ratio is stretched too. The windowed rectangle and style are restored on the way back. The toggle runs on the window's own thread. A window made by the title is not touched.
  • One log line with the frame rate: mean and longest gap between presents, and how long the limit held a present back (first piece of #728 phase 0; no behaviour change when the limit is off).
  • Config errors name their source (VICTORY_FPS_LIMIT, [display] fps_limit, window_mode). README and victory.example.toml document the keys.

Overlap: #433 ([window] size, start-up size) and #131 (borderless by default) touch the same window code. This adds no size setting and keeps the default windowed, so it should rebase on either; config.rs and host.rs will need a manual merge with #433. Not duplicated: no [window] table here.

Tested

  • cargo test --workspace --locked --no-fail-fast: 540 passed, 0 failed, 10 ignored (WARP, Windows 11). One earlier run failed inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset once and passed on the next two runs; this change does not touch inplace.rs; cause not investigated.
  • Unit tests: the pacer (no limit, spacing, late frame, a real 50 fps wait of at least 19 ms) and the config parsing (defaults, env over file, error sources).

Not tested

  • In the title: fps with and without the limit, and the F11 / Alt+Enter toggle on a real window. Runs are queued; no figure yet. non verifie.
  • The key also reaches the title (input is polled with GetAsyncKeyState), as the F3 key of #717 would. non verifie what the title does with F11.
  • Linux/Proton, multi-monitor, DPI. non verifie.
  • Frame pacing improvements (waitable swap chain, tearing, interval override of #728): not in this PR.

AI use
Written with Claude Sonnet 5.5 (Claude Code).

<!-- greyfinch-sync:fxceless/victory-fork:issue:6599275325 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/773). Originally posted by [Revens2](https://github.com/Revens2) on 2026-11-25T07:13:48Z. --- Refs #727 (window mode, fps limit) and #728 (phase 0, measurement). Does not close either. **What is in it** - `[display] fps_limit` in `victory.toml` (env `VICTORY_FPS_LIMIT`, 0 = off, at most 1000). Applied just before `Present`: sleep until 1.5 ms before the deadline, then spin. A late frame is not made up for (no burst after a slow frame). The title's own frame clock (`frame.rs`) is untouched. - `[display] window_mode = "windowed" | "borderless"` (env `VICTORY_WINDOW_MODE`) and F11 / Alt+Enter at run time, on the window `victory-gpu` creates. Borderless is a popup over the monitor the window is on (flip model, no exclusive fullscreen); the swap chain keeps the title's size and is stretched, so another aspect ratio is stretched too. The windowed rectangle and style are restored on the way back. The toggle runs on the window's own thread. A window made by the title is not touched. - One log line with the frame rate: mean and longest gap between presents, and how long the limit held a present back (first piece of #728 phase 0; no behaviour change when the limit is off). - Config errors name their source (`VICTORY_FPS_LIMIT`, `[display] fps_limit`, `window_mode`). README and `victory.example.toml` document the keys. Overlap: #433 (`[window] size`, start-up size) and #131 (borderless by default) touch the same window code. This adds no size setting and keeps the default windowed, so it should rebase on either; `config.rs` and `host.rs` will need a manual merge with #433. Not duplicated: no `[window]` table here. **Tested** - `cargo test --workspace --locked --no-fail-fast`: 540 passed, 0 failed, 10 ignored (WARP, Windows 11). One earlier run failed `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset` once and passed on the next two runs; this change does not touch `inplace.rs`; cause not investigated. - Unit tests: the pacer (no limit, spacing, late frame, a real 50 fps wait of at least 19 ms) and the config parsing (defaults, env over file, error sources). **Not tested** - In the title: fps with and without the limit, and the F11 / Alt+Enter toggle on a real window. Runs are queued; no figure yet. `non verifie`. - The key also reaches the title (input is polled with `GetAsyncKeyState`), as the F3 key of #717 would. `non verifie` what the title does with F11. - Linux/Proton, multi-monitor, DPI. `non verifie`. - Frame pacing improvements (waitable swap chain, tearing, interval override of #728): not in this PR. **AI use** Written with Claude Sonnet 5.5 (Claude Code).
chatgpt-codex-connector[bot commented 2026-11-25 08:08:58 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T07:14:00Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T07:17:05.933326Z 0ad4aeb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7155633598 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/773#issuecomment-7155633598). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T07:14:00Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"0ad4aeb39b4568c3e727e83713857c0da99be6b1","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T07:17:05.933326Z">2026-11-25T07:17:05.933326Z</relative-time> | `0ad4aeb` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/773:upstream-pr/773'
git switch 'upstream-pr/773'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/773'
git switch 'upstream-pr/773'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/773'
git switch 'upstream-pr/773'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/773'
git switch 'main'
git merge --squash 'upstream-pr/773'
git switch 'main'
git merge --ff-only 'upstream-pr/773'
git switch 'main'
git merge 'upstream-pr/773'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!773
No description provided.