Skip to content

setPresentMode FFI: runtime Fifo/Mailbox/Immediate + a working fps cap#80

Closed
proggeramlug wants to merge 1 commit into
fix/round2-stabilityfrom
feat/present-mode-ffi
Closed

setPresentMode FFI: runtime Fifo/Mailbox/Immediate + a working fps cap#80
proggeramlug wants to merge 1 commit into
fix/round2-stabilityfrom
feat/present-mode-ffi

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Stacked on #75. Audit F6: present mode was hardcoded Fifo everywhere, and setTargetFPS was silently inert because its sleep-based cap only runs when vsync is off.

  • Renderer::set_present_mode(0|1|2) reconfigures the live surface on change (no-op when unchanged, logged). All three modes are DXGI-native on Windows.
  • bloom_set_present_mode FFI + setPresentMode TS export + manifest entry.

Validated live at 4K: log shows present mode = Immediate, then getFPS pins at a steady 29 under setTargetFPS(30) — the cap engaging for the first time. This unlocks audit decision D1 (operating point): cap-45 vs cap-60 vs uncapped are now directly comparable.

Found during validation (worth knowing): calling any renderer FFI before initWindow panic-aborts with "Engine not initialized" (c0000409) — that's the exact signature of the older ucrtbase crash events in the Application log from past sessions.

Round-2 audit F6: the present mode was hardcoded Fifo at both surface
config sites, which also made setTargetFPS inert — its sleep-based cap
only engages when vsync is off, and vsync could never be off.

- Renderer::set_present_mode(0=Fifo, 1=Mailbox, 2=Immediate):
  reconfigures the live surface on change; no-op when unchanged; logs
  the switch. All three modes are DXGI-native on Windows.
- FFI bloom_set_present_mode + TS setPresentMode + manifest entry
  (Perry silently no-ops undeclared natives).

Validated on the live game at 4K: "bloom: present mode = Immediate"
followed by getFPS pinning at a steady 29 under setTargetFPS(30) —
the first time the cap has ever engaged. This is the knob that makes
audit decision D1 (operating point) testable: cap-45 / cap-60 /
uncapped can now be compared like-for-like.
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28ae87bc-9b0a-470b-b2ae-eeff908bdb24

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/present-mode-ffi

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed in main via the round-2 consolidation merge (#83). All commits from this branch are now on main; closing as merged-through-integration.

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