Fix green/black textures on 8 GB GPUs (target reserve settle, slot eviction, neutral stand-in) #1179

Manually merged
github merged 1 commit from github-bot/gh-1179 into main 2026-11-28 19:42:29 +00:00 AGit
Owner

@⁠EduardoMFOliveira on GitHub · 2026-11-28 14:57 UTC · original
EduardoMFOliveira:fix/8gb-green-black-textures → main · +32 −18 · 2 files · 1 commits · merged 2026-11-28 19:39 UTC

Summary

Fixes green and black textures observed on 8 GB GPUs (tested on an RTX 5060 Laptop GPU, 6.6–7.1 GB local budget, both Series X and Series S + FrameGen modes) without regressing FPS or stability.

Root Causes & Fixes

  1. Permanent render-target reserve (crates/victory-gpu/src/resource.rs — targets_kept):
    • targets_kept previously required targets >= most / 2 (1,536 MB) before settling to 0. On 8 GB / Series S / DLSS setups, in-world render targets stabilize around 1,185–1,450 MB, so the condition was never met and targets_room_kept() permanently added 1,620–1,887 MB of phantom usage to room(), locking 16k–31k textures out of the queue.
    • Lowered the threshold to (most / 4).min(1024 << 20) (768 MB with default most = 3072 MB), still safely above the ~652 MB pre-world menu baseline while allowing 8 GB / Series S / DLSS targets to settle.
  2. Slot eviction thresholds & table eligibility (resource.rs — slot_evict, descriptor/host.rs — HostHeap::slots_showing):
    • Clamped slot_evict's high/low watermarks against room_line(budget) and subtracted crate::pool::texture_room() from used, so eviction actually triggers when room() is capped at e.g. 80% (FrameGen).
    • Changed HostHeap::slots_showing from self.tabled_lately(i, frame) (which expired after TABLED_FRAMES = 240, shorter than idle_ms) to tabled_out() && self.tabled_stamp(i) != 0 so idle table-held textures can be evicted and re-mirrored on demand.
  3. Neutral 2D/2D-Array stand-in instead of null SRV (crates/victory-gpu/src/descriptor/host.rs — unmake, make_at, mirror):
    • Waiting, evicted, or unmade 2D / 2D-Array texture slots previously wrote null_for ((0, 0, 0, 0)), which renders black for albedo and bright green in YCoCg / BC5 normal-chrominance shaders (where 0.5 is subtracted). Replaced with neutral_for (1x1 R8G8B8A8_UNORM = 0x80).

Testing

  • cargo test --release -p victory-gpu: 453 passed; 0 failed (including updated room_for_targets_is_given_up_once_they_settle covering 1,185 MB world targets).
  • cargo build --release --locked -p victory: clean release build.
  • Verified in-game on RTX 5060 Laptop (8 GB) — green/black textures resolved.
**@⁠EduardoMFOliveira** on GitHub · 2026-11-28 14:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1179) `EduardoMFOliveira:fix/8gb-green-black-textures` → `main` · +32 −18 · 2 files · 1 commits · merged 2026-11-28 19:39 UTC ## Summary Fixes green and black textures observed on 8 GB GPUs (tested on an RTX 5060 Laptop GPU, 6.6–7.1 GB local budget, both Series X and Series S + FrameGen modes) without regressing FPS or stability. ### Root Causes & Fixes 1. **Permanent render-target reserve (`crates/victory-gpu/src/resource.rs` — `targets_kept`)**: - `targets_kept` previously required `targets >= most / 2` (1,536 MB) before settling to `0`. On 8 GB / Series S / DLSS setups, in-world render targets stabilize around 1,185–1,450 MB, so the condition was never met and `targets_room_kept()` permanently added 1,620–1,887 MB of phantom usage to `room()`, locking 16k–31k textures out of the queue. - Lowered the threshold to `(most / 4).min(1024 << 20)` (768 MB with default `most = 3072 MB`), still safely above the ~652 MB pre-world menu baseline while allowing 8 GB / Series S / DLSS targets to settle. 2. **Slot eviction thresholds & table eligibility (`resource.rs` — `slot_evict`, `descriptor/host.rs` — `HostHeap::slots_showing`)**: - Clamped `slot_evict`'s high/low watermarks against `room_line(budget)` and subtracted `crate::pool::texture_room()` from `used`, so eviction actually triggers when `room()` is capped at e.g. 80% (FrameGen). - Changed `HostHeap::slots_showing` from `self.tabled_lately(i, frame)` (which expired after `TABLED_FRAMES = 240`, shorter than `idle_ms`) to `tabled_out() && self.tabled_stamp(i) != 0` so idle table-held textures can be evicted and re-mirrored on demand. 3. **Neutral 2D/2D-Array stand-in instead of null SRV (`crates/victory-gpu/src/descriptor/host.rs` — `unmake`, `make_at`, `mirror`)**: - Waiting, evicted, or unmade 2D / 2D-Array texture slots previously wrote `null_for` (`(0, 0, 0, 0)`), which renders black for albedo and bright green in YCoCg / BC5 normal-chrominance shaders (where `0.5` is subtracted). Replaced with `neutral_for` (`1x1 R8G8B8A8_UNORM = 0x80`). ## Testing - `cargo test --release -p victory-gpu`: **453 passed; 0 failed** (including updated `room_for_targets_is_given_up_once_they_settle` covering 1,185 MB world targets). - `cargo build --release --locked -p victory`: clean release build. - Verified in-game on RTX 5060 Laptop (8 GB) — green/black textures resolved.
- Lower targets_kept() world threshold from most/2 (1536 MB) to (most/4).min(1 GiB) (768 MB) so 8 GB / Series S / DLSS target footprints (1185-1450 MB) settle instead of holding ~1.6-1.9 GB permanently.
- Clamp slot_evict() high/low thresholds against room_line(budget) and subtract pool::texture_room() so eviction activates when room() is tight (e.g. 80% with FrameGen).
- Fix HostHeap::slots_showing() to check tabled_out() && tabled_stamp(i) != 0 instead of tabled_lately() so idle table-held textures remain evictable past TABLED_FRAMES (240 frames).
- Use neutral_for() instead of null_for() in HostHeap::unmake, make_at, and mirror for 2D/2D-array views so waiting/evicted slots sample (0.5, 0.5, 0.5, 0.5) instead of (0, 0, 0, 0) (avoiding green YCoCg/BC5 and black albedo).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:00:39 +00:00
Author
Owner

@⁠T1bolus on GitHub · 2026-11-28 15:44 UTC · original

Confirmed on a setup bigger than the report's 8 GB cards: GeForce RTX 4070 SUPER 12 GB, AMD Ryzen 5 7600 (6 Zen 4 cores), Windows 11, Series S profile with DLSS performance and frame generation 2x. Built main with this PR and #1095 on top, and drove the same kind of street-parking scene that held whole rows of parked cars showing stale texture content for minutes.

log figure before with this PR + #1095
texture pass, held back for room, max per 5 s window 77,687 23,334 (avg 2,233)
texture pass, brought up to date although the card has no room, lines per run 679 142
preparing per frame 33.7 ms 30.9 ms
draws dropped without a host pipeline, per frame 267 135
fps 17.2 17.4
changed after its upload warnings 92 75

The parked cars' textures arrived with the frame they first appeared in instead of minutes later; the re-upload competition against room-full textures is largely gone. The stale warnings left over trace to title writes through aliased views (fixed separately), so the two figures do not share a root cause.

One merge note from a tree that carries the view remap and the alias-write fixes: unmake resolved as

self.keep(index, kept);
self.place_back(index);

— the neutral stand-in kept and the slot placed back. The kept from neutral_for(&view, ...) and the place_back wiring are independent, so both fit one branch.

cargo test -p victory-gpu --locked: 460 green.

**@⁠T1bolus** on GitHub · 2026-11-28 15:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1179#issuecomment-7241697828) Confirmed on a setup bigger than the report's 8 GB cards: GeForce RTX 4070 SUPER 12 GB, AMD Ryzen 5 7600 (6 Zen 4 cores), Windows 11, Series S profile with DLSS performance and frame generation 2x. Built main with this PR and #1095 on top, and drove the same kind of street-parking scene that held whole rows of parked cars showing stale texture content for minutes. | log figure | before | with this PR + #1095 | |---|---|---| | texture pass, held back for room, max per 5 s window | 77,687 | 23,334 (avg 2,233) | | texture pass, brought up to date although the card has no room, lines per run | 679 | 142 | | preparing per frame | 33.7 ms | 30.9 ms | | draws dropped without a host pipeline, per frame | 267 | 135 | | fps | 17.2 | 17.4 | | `changed after its upload` warnings | 92 | 75 | The parked cars' textures arrived with the frame they first appeared in instead of minutes later; the re-upload competition against room-full textures is largely gone. The stale warnings left over trace to title writes through aliased views (fixed separately), so the two figures do not share a root cause. One merge note from a tree that carries the view remap and the alias-write fixes: `unmake` resolved as ```rust self.keep(index, kept); self.place_back(index); ``` — the neutral stand-in kept **and** the slot placed back. The `kept` from `neutral_for(&view, ...)` and the `place_back` wiring are independent, so both fit one branch. cargo test -p victory-gpu --locked: 460 green.
Author
Owner

@⁠Exopus-0x65f7ad0 on GitHub · 2026-11-28 16:24 UTC · original

A run on an 8 GB desktop card in the Series X profile, as a complement to the 5060 Laptop and 4070 SUPER results above.

Setup: RTX 5060 Ti 8 GB (vram_budget_mb ~7,100), 16 GB RAM, Windows 11 26300. 63b902f + local commits, with and without this PR (one run each, same save). README launcher defaults: Series X, native 1440p, DLSS Quality, no frame generation. Prison opening: cutscene plus a scripted 90 s walk.

without with #1179
kept for render targets in the room lines 0 MB in 65 of 85 lines (2,831–2,863 MB only during the load) 0 MB in 69 of 88 (same load peaks)
room lines ending in no room 40 / 107 39 / 106
has no room for new ones lines 198 183
world fps, median (frame lines ≥ 4,000 draws) 16.4 16.2
ms/frame, median 60.9 61.6
errors 1 (Streamline presentCommon notice) the same 1
  • Neutral: at Series X 1440p the in-world targets are already above the old most / 2 threshold, so the reserve settles to 0 without the PR too. Fix 1 can't show here; it's the Series S / DLSS case, as you describe.
  • No regression: fps, room pressure and stability are unchanged, and the captured frames during the walk show no green or black surfaces with the neutral stand-in. This scene didn't show green/black textures without the PR either, though, so it doesn't exercise fix 3.

So nothing against it from the Series X side.

**@⁠Exopus-0x65f7ad0** on GitHub · 2026-11-28 16:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1179#issuecomment-7242224400) A run on an 8 GB **desktop** card in the **Series X** profile, as a complement to the 5060 Laptop and 4070 SUPER results above. **Setup:** RTX 5060 Ti 8 GB (`vram_budget_mb` ~7,100), 16 GB RAM, Windows 11 26300. `63b902f` + local commits, with and without this PR (one run each, same save). README launcher defaults: Series X, native 1440p, DLSS Quality, no frame generation. Prison opening: cutscene plus a scripted 90 s walk. | | without | with #1179 | |---|---|---| | `kept for render targets` in the room lines | 0 MB in 65 of 85 lines (2,831–2,863 MB only during the load) | 0 MB in 69 of 88 (same load peaks) | | room lines ending in `no room` | 40 / 107 | 39 / 106 | | `has no room for new ones` lines | 198 | 183 | | world fps, median (frame lines ≥ 4,000 draws) | 16.4 | 16.2 | | ms/frame, median | 60.9 | 61.6 | | errors | 1 (Streamline `presentCommon` notice) | the same 1 | - **Neutral:** at Series X 1440p the in-world targets are already above the old `most / 2` threshold, so the reserve settles to 0 without the PR too. Fix 1 can't show here; it's the Series S / DLSS case, as you describe. - **No regression:** fps, room pressure and stability are unchanged, and the captured frames during the walk show no green or black surfaces with the neutral stand-in. This scene didn't show green/black textures without the PR either, though, so it doesn't exercise fix 3. So nothing against it from the Series X side.
github-bot referenced this pull request from a commit 2026-11-28 19:41:56 +00:00
github manually merged commit 20c79c6fa3 into main 2026-11-28 19:42:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1179
No description provided.