Vehicles with black bodywork or missing panels: root views read across a 4 MiB line (from VIda) #41

Open
staticman256 wants to merge 1 commit from upstream-pr/41 into main
staticman256 commented 2026-12-04 08:45:11 +00:00 (Migrated from github.com)

Imported from ReTerryDavis/ReVIctory. Originally posted by staticman256 on 2026-12-04T08:45:11Z.


Vehicles with black bodywork or missing panels: root views read across a 4 MiB line (from VIda)

The README lists under known issues: "Some cars and trucks can still lose their painted
body at certain angles and look black." A cause of that was found by MTrv0 in
VIctory-AMD-UM (e923457) and is carried in VIda by
Zelbrad (471c423). It is brought onto current main here.

Based on main at 249f2aa. 2 files, +94 -9.

What was wrong

Title memory outside buffer objects is copied in windows named by 4 MiB cells. A root view
is bound without a length, so its window ended at its cell's line. The vehicles' paint
programs bind such views shortly before a line (560 bytes to 51 KB before it in MTrv0's
run), and on the console the read simply goes on into the next bytes. Here zeros were read:
bodies black in places, doors and hoods gone.

What is changed

  • shadow.rs: find_root and find_root_with are added for root views that a shader
    only reads (root constant buffers and shader resource views). Outside buffer objects, an
    address with less than the reach left in its cell is given a window over the line: the
    last reach bytes of the cell and the first reach of the next (ask_window), not the
    two cells whole. Everything else is passed to find / find_with as before. loose
    is given the reach as a fifth parameter; its other callers pass 0. Root unordered views
    keep find, so what shaders write is still copied back from the copy they wrote.
  • draw.rs: the two lookups for read-only root views (root_view and the root SRV
    slot) are made through find_root_with / find_root.
  • A unit test for the window a root view is named by (a_root_view_near_a_cell_line_gets_a_window_over_it).

The same VIda commit holds a second fix (a texture slot the title rewrites every frame
keeps its first due frame). It is left out here: the tested car was right without it.

Switches

  • VICTORY_ROOT_REACH_KB (1024 unset; rounded up to 64 KiB, at most 4096; 0: as before).
    1024 is what MTrv0's play.ps1 and VIda's launcher are run with; 256 is the default in
    MTrv0's code.

What to look for in a log

root views near a 4 MiB line get a window over it (VICTORY_ROOT_REACH_KB) reach_kb=1024

Tested

RX 9070 XT, Windows 11, diag build started from play.ps1 (FSR 4 performance with frame
generation, no ray tracing). The runs were made with a build that also held VIda's second
fix behind a switch; with that switch off the code that ran is the code of this PR.

  • Before the change, the red starting car of chapter 2 was black in places, and the places
    changed as the car was damaged.
  • With the change, its bodywork was painted right. The log line above was written with
    reach_kb=1024, and no device loss was logged.
  • With VICTORY_ROOT_REACH_KB=0, the black panels were back.
  • With the second fix switched off and the reach at 1024, the car stayed right.
  • With the change, the trunk lid of that car no longer stayed where it was after it had
    been opened, and other deformations of the car were shown right: a fault seen for a long
    time before.
  • Clippy for Windows with --all-targets, with and without the diagnostics feature, and a
    release check, for victory-gpu and victory-shader on 249f2aa: no warnings.

Not tested

  • Other vehicles, and long sessions.
  • The unit test was written and type-checked, not executed before this PR.
  • The memory the bridge windows take (two times the reach for each line a root view
    starts near) was not measured.
  • NVIDIA cards.

Claude Fable 5.2/High

<!-- greyfinch-sync:ReTerryDavis/ReVIctory:issue:5643284176 --> Imported from [ReTerryDavis/ReVIctory](https://github.com/ReTerryDavis/ReVIctory/pull/41). Originally posted by [staticman256](https://github.com/staticman256) on 2026-12-04T08:45:11Z. --- ## Vehicles with black bodywork or missing panels: root views read across a 4 MiB line (from VIda) The README lists under known issues: "Some cars and trucks can still lose their painted body at certain angles and look black." A cause of that was found by MTrv0 in VIctory-AMD-UM (e923457) and is carried in [VIda](https://github.com/Zelbrad/VIda) by Zelbrad (471c423). It is brought onto current `main` here. Based on `main` at 249f2aa. 2 files, +94 -9. ### What was wrong Title memory outside buffer objects is copied in windows named by 4 MiB cells. A root view is bound without a length, so its window ended at its cell's line. The vehicles' paint programs bind such views shortly before a line (560 bytes to 51 KB before it in MTrv0's run), and on the console the read simply goes on into the next bytes. Here zeros were read: bodies black in places, doors and hoods gone. ### What is changed - **`shadow.rs`**: `find_root` and `find_root_with` are added for root views that a shader only reads (root constant buffers and shader resource views). Outside buffer objects, an address with less than the reach left in its cell is given a window over the line: the last `reach` bytes of the cell and the first `reach` of the next (`ask_window`), not the two cells whole. Everything else is passed to `find` / `find_with` as before. `loose` is given the reach as a fifth parameter; its other callers pass 0. Root unordered views keep `find`, so what shaders write is still copied back from the copy they wrote. - **`draw.rs`**: the two lookups for read-only root views (`root_view` and the root SRV slot) are made through `find_root_with` / `find_root`. - A unit test for the window a root view is named by (`a_root_view_near_a_cell_line_gets_a_window_over_it`). The same VIda commit holds a second fix (a texture slot the title rewrites every frame keeps its first due frame). It is left out here: the tested car was right without it. ### Switches - `VICTORY_ROOT_REACH_KB` (1024 unset; rounded up to 64 KiB, at most 4096; `0`: as before). 1024 is what MTrv0's `play.ps1` and VIda's launcher are run with; 256 is the default in MTrv0's code. ### What to look for in a log ``` root views near a 4 MiB line get a window over it (VICTORY_ROOT_REACH_KB) reach_kb=1024 ``` ### Tested RX 9070 XT, Windows 11, diag build started from `play.ps1` (FSR 4 performance with frame generation, no ray tracing). The runs were made with a build that also held VIda's second fix behind a switch; with that switch off the code that ran is the code of this PR. - Before the change, the red starting car of chapter 2 was black in places, and the places changed as the car was damaged. - With the change, its bodywork was painted right. The log line above was written with `reach_kb=1024`, and no device loss was logged. - With `VICTORY_ROOT_REACH_KB=0`, the black panels were back. - With the second fix switched off and the reach at 1024, the car stayed right. - With the change, the trunk lid of that car no longer stayed where it was after it had been opened, and other deformations of the car were shown right: a fault seen for a long time before. - Clippy for Windows with `--all-targets`, with and without the diagnostics feature, and a release check, for `victory-gpu` and `victory-shader` on 249f2aa: no warnings. ### Not tested - Other vehicles, and long sessions. - The unit test was written and type-checked, not executed before this PR. - The memory the bridge windows take (two times the reach for each line a root view starts near) was not measured. - NVIDIA cards. --- Claude Fable 5.2/High
Ace-Zer0x77 commented 2026-12-04 11:19:50 +00:00 (Migrated from github.com)

Imported from ReTerryDavis/ReVIctory. Originally posted by Ace-Zer0x77 on 2026-12-04T11:19:50Z.


Tested on previctory-v0.5.0-next (81bafbf, based on 249f2aa) with an RX 9070 XT (Series X @ 1440p and Series S @ 1080p, 30/40 FPS caps with FSR + Frame Gen):

  • Result: No black bodywork or missing panels seen on tested vehicles/traffic across city, foliage, and bridge runs; no regressions noticed in command submission or frame pacing.
  • Next up: Planning to pass this build to a tester on an RX 6800 XT (RDNA 2) to verify behavior there as well.
<!-- greyfinch-sync:ReTerryDavis/ReVIctory:comment:7409947503 --> Imported from [ReTerryDavis/ReVIctory](https://github.com/ReTerryDavis/ReVIctory/pull/41#issuecomment-7409947503). Originally posted by [Ace-Zer0x77](https://github.com/Ace-Zer0x77) on 2026-12-04T11:19:50Z. --- Tested on `previctory-v0.5.0-next` (`81bafbf`, based on `249f2aa`) with an **RX 9070 XT** (Series X @ 1440p and Series S @ 1080p, 30/40 FPS caps with FSR + Frame Gen): * **Result:** No black bodywork or missing panels seen on tested vehicles/traffic across city, foliage, and bridge runs; no regressions noticed in command submission or frame pacing. * **Next up:** Planning to pass this build to a tester on an **RX 6800 XT** (RDNA 2) to verify behavior there as well.
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/41:upstream-pr/41'
git switch 'upstream-pr/41'

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/41'
git switch 'upstream-pr/41'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/41'
git switch 'upstream-pr/41'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/41'
git switch 'main'
git merge --squash 'upstream-pr/41'
git switch 'main'
git merge --ff-only 'upstream-pr/41'
git switch 'main'
git merge 'upstream-pr/41'
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
ReTerryDavis/ReVIctory!41
No description provided.