[pr-feature][rendering] Vignette off (DARNER_VIGNETTE=0, off by default; F1 PICTURE > VIGNETTE, live) #12

Open
Jesper-A wants to merge 2 commits from Jesper-A/Darner:pr6-vignette into main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit.

Base: the branch (2 commits) is on 4db98e011, the main commit it was cut from. main is now 4a92569fb. Not rebased (WIP; we rebase before WIP comes off, or sooner if you ask). A text-only trial merge (git merge-tree --write-tree --name-only trustno1/main pr6-vignette) conflicts in crates/darner-gpu/src/host/menu.rs (the F1 menu table) only; README.md, apps/darner/src/play.rs, apps/darner/src/run.rs and crates/darner-hle/src/lib.rs merge cleanly.

This is a draft. It has not been run in the game; the cargo results are below.

New switch: DARNER_VIGNETTE=0. Default: not set, meaning the game's own vignette (the darkened picture edges), nothing changed and no byte of the title written. With the switch at 0 the vignette is taken off.

How: every vignette the title draws, whatever asked for it, reaches the card through one packing routine. With the switch at 0, an entry hook (darner_hle::viewhook, darner_loader::callhook::hook_entry) hands that routine a per-thread copy of the 0x40-byte vignette with its strength (a float at +0x30) set to 0, the strength an empty vignette has. The title's own values are never written.

  • Live. DARNER_VIGNETTE is read at each use (darner_gpu::view_fx), so F1 > PICTURE > VIGNETTE (ON / OFF) changes it while the game runs.
  • Armed only when the variable is present at the start (any value; 1 arms it with the vignette on, and F1 then turns it off and on). Unset: no hook is installed and nothing is written; the F1 row says NOT ARMED, and saving ON or OFF in F1 arms it from the next start.
  • Checked first. The packer's prologue, three inner byte patterns and its two call sites are compared with the expected bytes, and none is read outside the image. If anything differs (a build of the title this does not know) the hook is not put in, vignette: NOT ACTIVE is logged once and F1 shows NOT ACTIVE. The offsets are for one known build, the one mousehook already knows.
  • No shader change, so the shader cache key is unchanged. Unit tests use synthetic code and images only.
  • Also: a README row (Picture and upscaling), a docs/findings.md entry, and the name in players_own in apps/darner/src/play.rs.

Diff against 4db98e011: 9 files (README.md, apps/darner/src/play.rs, apps/darner/src/run.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-gpu/src/view_fx.rs (new), crates/darner-hle/src/lib.rs, crates/darner-hle/src/viewhook.rs (new), docs/findings.md).

Credit: a port of the vignette part of a pull request in the project's earlier GitHub repository (author NICKNAMErutschovkonikovan; that repository is gone, so there is no link). The idea, the place in the title's code and the offsets are theirs. The code is re-written with our names for this tree. The commit message carries a Co-authored-by line for them. They had it on by default; here it is off by default.

No upstream issue covers this, so there is no Fixes or Refs line.

Spec dependence

  • Likely general: the hook is CPU-side code in the title's image, with no GPU, driver or shader involvement, so it should not depend on the card.
  • May depend on our setup (RTX 2070 SUPER 8 GB Turing, ReBAR off, Ryzen 7 5800X, 32 GB, Series S + DLSS Performance): nothing known. Whether it works at all depends on the title build matching the expected bytes, not on the PC.
  • Untested elsewhere: every other setup, and every other build of the title. We have no game run of it.

How it was tested

  • Tested revision: b566aa117 (branch pr6-vignette, based on 4db98e011; main has moved, see Base).
  • Commands and results:
    • cargo clippy --workspace --all-targets --locked -- -D warnings with -A clippy::unnecessary_lazy_evaluations added: passed. The exact command without that flag was not run.
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings, the same flag added: passed.
    • Tests: darner-hle and darner (the crates this touches outside the GPU crate): passed. darner-gpu, full library: one test failed, watch::tests::ask_once_by_res_splits_reservations_without_refusals (once also watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs). It is in a test file this change does not touch and it passes when run alone. We did not run main for comparison, so we do not know whether it is flaky or an old failure. cargo test --workspace --locked as one command was not run.
    • cargo xtask policy: passed.
    • There is no CI upstream; nothing here was checked by CI.
  • Gameplay, when relevant: not run for this switch.
  • Before and after, when relevant: none.
  • Shader wave sizes tested, when relevant: not relevant (no shader change).
  • Coverage gaps: not run in the game at all, so it is not known whether the whole vignette goes and the title's other post effects stay as they were; cutscenes and scopes; any other build of the title (it should log NOT ACTIVE and do nothing, but that path is only covered by synthetic bytes); other GPUs; Series X profile; frame generation on; the branch on current main.

Checklist

  • This PR contains one change based on main. (git diff --stat 4db98e011 b566aa117: the 9 files above. The branch is on 4db98e011, not on current main; a trial merge conflicts in host/menu.rs, see Base.)
  • The diff follows docs/asset-policy.md. (Text only; cargo xtask policy passed. The hook's byte patterns follow the style of mousehook.rs.)
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for a vignette switch. On 2026-12-03 this host had 3 issues (#1, #2, #4) and 8 pull requests (#3 by another contributor; #5 to #11 ours, WIP) in total; I searched their titles and bodies for vignette: nothing. The other contributor's pull request (#3, ray tracing mode in F1) changes host/menu.rs, host/panel.rs and hwrt.rs: same file menu.rs as this change's F1 row, different change. Our own re-filed branches overlap: pr4-dof (depth of field, DARNER_DOF=0) also creates view_fx.rs and viewhook.rs, so whichever merges second needs a rebase; our lens flare branch pr6-lens-flare builds on this one. Other F1 rows from our earlier CodeFloe PRs (not migrated) also edit menu.rs. Expect small merge conflicts in the F1 menu table.
  • Our own re-filed PRs that touch the same files: #6 (README.md, crates/darner-gpu/src/lib.rs, docs/findings.md); #7 (docs/findings.md); #8 (README.md, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, docs/findings.md); #9 (README.md, apps/darner/src/play.rs, apps/darner/src/run.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-gpu/src/view_fx.rs, crates/darner-hle/src/lib.rs, crates/darner-hle/src/viewhook.rs, docs/findings.md); #10 (README.md, docs/findings.md); #11 (README.md, apps/darner/src/run.rs). #5 share no file. Different changes; whichever lands first, the others take its rows when they are rebased.

Update 2026-12-03: marked ready as it stands; the 'draft' and 'not rebased' wording above is out of date, nothing was re-run in the game, and the maintainer will handle the rebase.

This change was made with AI assistance (Claude Code).

## Contributor role (optional) - Fluxer ID: ## What it changes Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit. **Base:** the branch (2 commits) is on `4db98e011`, the `main` commit it was cut from. `main` is now `4a92569fb`. Not rebased (WIP; we rebase before WIP comes off, or sooner if you ask). A text-only trial merge (`git merge-tree --write-tree --name-only trustno1/main pr6-vignette`) **conflicts** in `crates/darner-gpu/src/host/menu.rs` (the F1 menu table) only; `README.md`, `apps/darner/src/play.rs`, `apps/darner/src/run.rs` and `crates/darner-hle/src/lib.rs` merge cleanly. This is a draft. It has not been run in the game; the cargo results are below. **New switch: `DARNER_VIGNETTE=0`.** Default: not set, meaning the game's own vignette (the darkened picture edges), nothing changed and no byte of the title written. With the switch at 0 the vignette is taken off. How: every vignette the title draws, whatever asked for it, reaches the card through one packing routine. With the switch at 0, an entry hook (`darner_hle::viewhook`, `darner_loader::callhook::hook_entry`) hands that routine a per-thread copy of the 0x40-byte vignette with its strength (a float at +0x30) set to 0, the strength an empty vignette has. The title's own values are never written. - **Live.** `DARNER_VIGNETTE` is read at each use (`darner_gpu::view_fx`), so F1 > PICTURE > VIGNETTE (ON / OFF) changes it while the game runs. - **Armed only when the variable is present at the start** (any value; `1` arms it with the vignette on, and F1 then turns it off and on). Unset: no hook is installed and nothing is written; the F1 row says NOT ARMED, and saving ON or OFF in F1 arms it from the next start. - **Checked first.** The packer's prologue, three inner byte patterns and its two call sites are compared with the expected bytes, and none is read outside the image. If anything differs (a build of the title this does not know) the hook is not put in, `vignette: NOT ACTIVE` is logged once and F1 shows NOT ACTIVE. The offsets are for one known build, the one `mousehook` already knows. - No shader change, so the shader cache key is unchanged. Unit tests use synthetic code and images only. - Also: a README row (Picture and upscaling), a `docs/findings.md` entry, and the name in `players_own` in `apps/darner/src/play.rs`. Diff against `4db98e011`: 9 files (`README.md`, `apps/darner/src/play.rs`, `apps/darner/src/run.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-gpu/src/view_fx.rs` (new), `crates/darner-hle/src/lib.rs`, `crates/darner-hle/src/viewhook.rs` (new), `docs/findings.md`). **Credit:** a port of the vignette part of a pull request in the project's earlier GitHub repository (author **NICKNAMErutschovkonikovan**; that repository is gone, so there is no link). The idea, the place in the title's code and the offsets are theirs. The code is re-written with our names for this tree. The commit message carries a `Co-authored-by` line for them. They had it on by default; here it is off by default. No upstream issue covers this, so there is no `Fixes` or `Refs` line. ### Spec dependence - **Likely general:** the hook is CPU-side code in the title's image, with no GPU, driver or shader involvement, so it should not depend on the card. - **May depend on our setup** (RTX 2070 SUPER 8 GB Turing, ReBAR off, Ryzen 7 5800X, 32 GB, Series S + DLSS Performance): nothing known. Whether it works at all depends on the title build matching the expected bytes, not on the PC. - **Untested elsewhere:** every other setup, and every other build of the title. We have no game run of it. ## How it was tested - Tested revision: `b566aa117` (branch `pr6-vignette`, based on `4db98e011`; `main` has moved, see Base). - Commands and results: - `cargo clippy --workspace --all-targets --locked -- -D warnings` with `-A clippy::unnecessary_lazy_evaluations` added: passed. The exact command without that flag was not run. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`, the same flag added: passed. - Tests: `darner-hle` and `darner` (the crates this touches outside the GPU crate): passed. `darner-gpu`, full library: one test failed, `watch::tests::ask_once_by_res_splits_reservations_without_refusals` (once also `watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs`). It is in a test file this change does not touch and it passes when run alone. We did not run `main` for comparison, so we do not know whether it is flaky or an old failure. `cargo test --workspace --locked` as one command was not run. - `cargo xtask policy`: passed. - There is no CI upstream; nothing here was checked by CI. - Gameplay, when relevant: not run for this switch. - Before and after, when relevant: none. - Shader wave sizes tested, when relevant: not relevant (no shader change). - Coverage gaps: not run in the game at all, so it is not known whether the whole vignette goes and the title's other post effects stay as they were; cutscenes and scopes; any other build of the title (it should log NOT ACTIVE and do nothing, but that path is only covered by synthetic bytes); other GPUs; Series X profile; frame generation on; the branch on current `main`. ## Checklist - [x] This PR contains one change based on `main`. (`git diff --stat 4db98e011 b566aa117`: the 9 files above. The branch is on `4db98e011`, not on current `main`; a trial merge conflicts in `host/menu.rs`, see Base.) - [x] The diff follows `docs/asset-policy.md`. (Text only; `cargo xtask policy` passed. The hook's byte patterns follow the style of `mousehook.rs`.) - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for a vignette switch. On 2026-12-03 this host had 3 issues (#1, #2, #4) and 8 pull requests (#3 by another contributor; #5 to #11 ours, WIP) in total; I searched their titles and bodies for vignette: nothing. The other contributor's pull request (#3, ray tracing mode in F1) changes `host/menu.rs`, `host/panel.rs` and `hwrt.rs`: same file `menu.rs` as this change's F1 row, different change. Our own re-filed branches overlap: `pr4-dof` (depth of field, `DARNER_DOF=0`) also creates `view_fx.rs` and `viewhook.rs`, so whichever merges second needs a rebase; our lens flare branch `pr6-lens-flare` builds on this one. Other F1 rows from our earlier CodeFloe PRs (not migrated) also edit `menu.rs`. Expect small merge conflicts in the F1 menu table. - Our own re-filed PRs that touch the same files: #6 (`README.md`, `crates/darner-gpu/src/lib.rs`, `docs/findings.md`); #7 (`docs/findings.md`); #8 (`README.md`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `docs/findings.md`); #9 (`README.md`, `apps/darner/src/play.rs`, `apps/darner/src/run.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-gpu/src/view_fx.rs`, `crates/darner-hle/src/lib.rs`, `crates/darner-hle/src/viewhook.rs`, `docs/findings.md`); #10 (`README.md`, `docs/findings.md`); #11 (`README.md`, `apps/darner/src/run.rs`). #5 share no file. Different changes; whichever lands first, the others take its rows when they are rebased. Update 2026-12-03: marked ready as it stands; the 'draft' and 'not rebased' wording above is out of date, nothing was re-run in the game, and the maintainer will handle the rebase. This change was made with AI assistance (Claude Code).
Port of the vignette part of PR #3590 of the earlier GitHub repo (author
NICKNAMErutschovkonikovan), as carried on our branches (c32297b6b), with the
Darner names.

An entry hook on the title's vignette packer hands it a per-thread copy of
the vignette with strength 0 while the setting is off; the title's own values
are never written. The hook is armed only when DARNER_VIGNETTE is present at
the start (any value); unset installs nothing and writes no byte. The packer,
its inner bytes and its two call sites are checked first; when they differ it
logs NOT ACTIVE once and does nothing. The F1 row says NOT ARMED / NOT ACTIVE.
No shader change. Unit tests use synthetic code and images only.

Co-authored-by: NICKNAMErutschovkonikovan <[email protected]>

This change was made with AI assistance (Claude Code).
The row and the findings entry for the vignette switch of the commit before (port of PR #3590 of the earlier GitHub repo, author NICKNAMErutschovkonikovan).

This change was made with AI assistance (Claude Code).
Jesper-A changed title from WIP: [pr-feature][rendering] Vignette off (DARNER_VIGNETTE=0, off by default; F1 PICTURE > VIGNETTE, live) to [pr-feature][rendering] Vignette off (DARNER_VIGNETTE=0, off by default; F1 PICTURE > VIGNETTE, live) 2026-12-03 18:29:18 +00:00
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/darner-gpu/src/host/menu.rs
  • docs/findings.md
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 'pr6-vignette:Jesper-A-pr6-vignette'
git switch 'Jesper-A-pr6-vignette'

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 'Jesper-A-pr6-vignette'
git switch 'Jesper-A-pr6-vignette'
git rebase 'main'
git switch 'main'
git merge --ff-only 'Jesper-A-pr6-vignette'
git switch 'Jesper-A-pr6-vignette'
git rebase 'main'
git switch 'main'
git merge --no-ff 'Jesper-A-pr6-vignette'
git switch 'main'
git merge --squash 'Jesper-A-pr6-vignette'
git switch 'main'
git merge --ff-only 'Jesper-A-pr6-vignette'
git switch 'main'
git merge 'Jesper-A-pr6-vignette'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!12
No description provided.