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

Manually merged
github merged 1 commit from github-bot/gh-41 into main 2026-12-04 21:30:58 +00:00 AGit
Owner

@⁠staticman256 on GitHub · 2026-12-04 08:45 UTC · original
staticman256:car-bodywork → main · +94 −9 · 2 files · 1 commits · merged 2026-12-04 21:26 UTC

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

**@⁠staticman256** on GitHub · 2026-12-04 08:45 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/41) `staticman256:car-bodywork` → `main` · +94 −9 · 2 files · 1 commits · merged 2026-12-04 21:26 UTC ## 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
Two fixes from Zelbrad/VIda 471c423. A root view a shader only reads, bound without a length less than VICTORY_ROOT_REACH_KB (1024) before a 4 MiB line of title memory outside buffer objects, gets a window over the line instead of its cell's end, where it read zeros (shadow::find_root; from MTrv0/VIctory-AMD-UM e923457). A queued texture slot the title writes again every frame keeps the first due frame of its wait, so its texture is uploaded (VICTORY_TABLED_FIRST_DUE, on unless 0). VICTORY_ROOT_REACH_KB=0 and VICTORY_TABLED_FIRST_DUE=0 give the behaviour as before.

Co-authored-by: Zelbrad <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 08:46:39 +00:00
github-bot changed title from Vehicles with black bodywork or missing panels: two fixes from VIda to Vehicles with black bodywork or missing panels: root views read across a 4 MiB line (from VIda) 2026-12-04 09:02:23 +00:00
github-bot force-pushed github-bot/gh-41 from fc9d7364a1 to 46a943f0bd 2026-12-04 09:02:26 +00:00 Compare
Author
Owner

@⁠Ace-Zer0x77 on GitHub · 2026-12-04 11:19 UTC · original

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.
**@⁠Ace-Zer0x77** on GitHub · 2026-12-04 11:19 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/41#issuecomment-7409947503) 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.
github-bot force-pushed github-bot/gh-41 from 46a943f0bd to 2d0ed64bcf 2026-12-04 16:17:47 +00:00 Compare
github manually merged commit cd700088d3 into main 2026-12-04 21:30:58 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.