WIP: Variable-rate shading: the title's rates reach the card (DARNER_VRS), with the title's own VRS switched on (DARNER_VRS_GATE, _PASSES, _CAP) #454

Draft
Striker00420 wants to merge 1 commit from striker00420/vrs-passthrough into Main AGit
First-time contributor

The title has a complete variable-rate-shading path that Darner took and did not apply, and whose master gate nothing in the build sets. DARNER_VRS=1 passes its rates and rate image to the card (slots 0x3f0/0x3f8, the host tile size in OPTIONS6); DARNER_VRS_GATE/PASSES/CAP switch the title's own VRS on (gate byte, per-pass table template, rate cap), all off by default and checked by BLAKE3 like frame_rate.rs. Not measured yet (bench runs on an RTX 3060 are queued; WIP). Details in the commit message. Generated with Claude Code (https://claude.com/claude-code).

The title has a complete variable-rate-shading path that Darner took and did not apply, and whose master gate nothing in the build sets. DARNER_VRS=1 passes its rates and rate image to the card (slots 0x3f0/0x3f8, the host tile size in OPTIONS6); DARNER_VRS_GATE/PASSES/CAP switch the title's own VRS on (gate byte, per-pass table template, rate cap), all off by default and checked by BLAKE3 like frame_rate.rs. Not measured yet (bench runs on an RTX 3060 are queued; WIP). Details in the commit message. Generated with Claude Code (https://claude.com/claude-code).
The title (game_scarlett_master.exe 1.0.2.1) has a complete variable-rate-shading path: a per-draw rate packed
into its context (+0x248c0f0), sent with RSSetShadingRate (list slot 0x3f0) by its state flush (+0x32638) when it
changes, a rate image set with RSSetShadingRateImage (slot 0x3f8, +0x248c140) and built by a compute pass, a console
extension on slot 0x400 (+0x248c1b0), and a per-pass control (+0x369e10) over ten render passes through a 21-entry
table (+0x8770204, copied at start-up from read-only data at +0x6202960). Darner took the rate call and applied
nothing (every pixel shaded at full rate), and had no handler for the image or the extension.

But the title never asks: its master gate byte (+0x8770340) is set by nothing in the build (its one writer, the VRS
init +0x5787800, clears it when the device's tile size is not 8 or 16), and the table enables one pass (0x13).

- `DARNER_VRS=1` (crates/darner-gpu/src/vrs.rs; off by default): the rate and its two combiners and the rate image
  go to the host list through the draw state (list.rs `shading_rate_words` / `shading_rate_image`, the thin lists'
  recorders, draw.rs `State::set_shading_rate` / `set_rate_image`, replayed after a cut); the host's own rate-image
  tile size is reported in OPTIONS6 (16 on NVIDIA; `DARNER_VRS_TILE` forces 8 or 16); slot 0x400 is a no-op that is
  noted once. Without the switch the calls are taken and not applied, as before, and 0x3f8 / 0x400 no longer fall to
  the missing-method handler.
- `DARNER_VRS_GATE=1`, `DARNER_VRS_PASSES=all|<ids>`, `DARNER_VRS_CAP=<n>` (crates/darner-loader/src/vrs.rs): the
  gate byte written and kept at 1; the enable bytes of the named passes set in the template before the title copies
  it; the rate cap byte (+0x8770347, `vrs.maxsr` of the title's visual settings, 1 as shipped) held. Three places are
  compared by length and BLAKE3 first, as frame_rate.rs does (no title bytes kept in the source); if one differs,
  nothing is changed. Only for the retail build.

Not measured yet: bench runs are queued on an RTX 3060 (phase 17 of the author's plan). Which pass ids are the
G-buffer and the lighting passes is not known; pass 0x0e clears three or four targets before its draws and is the
best guess for the G-buffer pass (`DARNER_VRS_PASSES=14`).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Striker00420 force-pushed striker00420/vrs-passthrough from b0ae492645 to b95d6c6509 2026-12-05 05:41:05 +00:00 Compare
Striker00420 force-pushed striker00420/vrs-passthrough from b95d6c6509 to b96f069698 2026-12-05 18:11:13 +00:00 Compare
Striker00420 force-pushed striker00420/vrs-passthrough from b96f069698 to d338b526af 2026-12-05 21:53:55 +00:00 Compare
Striker00420 force-pushed striker00420/vrs-passthrough from d338b526af to 3e59accb8a 2026-12-05 21:54:35 +00:00 Compare
TrustNo1 changed title from WIP: [pr-feature][rendering][NVIDIA] Variable-rate shading: the title's rates reach the card (DARNER_VRS), with the title's own VRS switched on (DARNER_VRS_GATE, _PASSES, _CAP) to WIP: Variable-rate shading: the title's rates reach the card (DARNER_VRS), with the title's own VRS switched on (DARNER_VRS_GATE, _PASSES, _CAP) 2026-12-06 03:28:48 +00:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/454/head:striker00420/vrs-passthrough'
git switch 'striker00420/vrs-passthrough'

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 'striker00420/vrs-passthrough'
git switch 'striker00420/vrs-passthrough'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'striker00420/vrs-passthrough'
git switch 'striker00420/vrs-passthrough'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'striker00420/vrs-passthrough'
git switch 'Main'
git merge --squash 'striker00420/vrs-passthrough'
git switch 'Main'
git merge --ff-only 'striker00420/vrs-passthrough'
git switch 'Main'
git merge 'striker00420/vrs-passthrough'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
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!454
No description provided.