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

Open
github-bot wants to merge 1 commit from github-bot/gh-773 into main AGit
Owner

@⁠Revens2 on GitHub · 2026-11-25 07:13 UTC · original
Revens2:fix/issue-727 → main · +366 −5 · 9 files · 1 commits · open

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).

**@⁠Revens2** on GitHub · 2026-11-25 07:13 UTC · [original](https://github.com/fxceless/victory-fork/pull/773) `Revens2:fix/issue-727` → `main` · +366 −5 · 9 files · 1 commits · open 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).
Adds an optional frame-rate limit applied before Present (sleep, then spin; a late frame is not made up for), a window mode switch on the presenting window (F11 or Alt+Enter, or window_mode = borderless at start), and a log line with the gaps between presents. Refs #727 and #728 (phase 0).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:50:49 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 07:14 UTC · original · edited 2026-11-25 07:17 UTC

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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 07:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/773#issuecomment-7155633598) · edited 2026-11-25 07:17 UTC <!-- 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 has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/773/head:github-bot/gh-773'
git switch 'github-bot/gh-773'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-773'
git switch 'github-bot/gh-773'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-773'
git switch 'github-bot/gh-773'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-773'
git switch 'main'
git merge --squash 'github-bot/gh-773'
git switch 'main'
git merge --ff-only 'github-bot/gh-773'
git switch 'main'
git merge 'github-bot/gh-773'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.