Skip to content

1D, 3D and cube slots waiting for their texture show a gray stand-in of their kind, not black (VICTORY_NEUTRAL_ALL_KINDS) - #3780

Open
Mikey970 wants to merge 1 commit into
trustno1-coder:mainfrom
Mikey970:pr/neutral-all-kinds
Open

Mikey970 wants to merge 1 commit into
trustno1-coder:mainfrom
Mikey970:pr/neutral-all-kinds

Conversation

@Mikey970

Copy link
Copy Markdown
Contributor

[pr-fix] Textures: 1D, 3D and cube slots waiting for their texture show a gray stand-in of their kind, not black (VICTORY_NEUTRAL_ALL_KINDS)

Fixes #

What it changes

When a texture slot has no texture to show yet (its texture is still waiting for its upload, was never made, or was let go), descriptor/host.rs neutral_for gives it the 1x1 gray (0x80) stand-in. That only works for 2D views and 2D arrays. A 1D, 1D-array, 3D, cube or cube-array view gets null_for, a null view of its kind. A null SRV reads as zeros, so a material sampling a volume or a cube at that moment reads black, where a 2D texture in the same state already reads gray.

This change:

  • makes neutral() into neutral_of(kind), which makes each stand-in once (OnceLock, as before): the 1x1 2D one (unchanged), a 1-texel 1D one, a 1x1x1 3D one, and a 1x1 cube (a 2D texture with six slices, every face filled from the same gray texel). All are R8G8B8A8_UNORM 0x80 with one level, and are uploaded the way the 2D one already is (a copy queue, crate::host::before_send, a fence wait).
  • has neutral_for give 1D/1D-array, 3D and cube/cube-array views a view of the slot's own dimension of the matching stand-in. Multisampled views, buffers and everything else still get their null view, as before.
  • adds a switch, VICTORY_NEUTRAL_ALL_KINDS, which is on by default. =0 keeps only 2D views and arrays, which is what happens now.
  • adds a counter, descriptor::host::NEUTRAL_KINDS: how many slots were given each kind of stand-in since the start (2D, 1D, 3D, cube). It is logged next to the VICTORY_GONE_NEUTRAL count in copystat::log_memory, so it shows only in a diagnostics build. Any build also logs one line the first time each non-2D stand-in is made.

What it targets, plainly: in our runs we saw black, hard-edged blotches while textures stream in, for example on a boat deck. We have not yet shown that this change is what removes them. It is defensive: it makes 1D, 3D and cube slots behave the way 2D slots already do upstream (black becomes neutral gray), and the counter shows how many slots it covers.

Files: crates/victory-gpu/src/descriptor/host.rs (Neutral, neutral_all_kinds, neutral_of, make_neutral, neutral_for, NEUTRAL_KINDS, the test) and crates/victory-gpu/src/copystat.rs (one log line). Nothing in victory-shader or shader_cache.rs changes, so the shader cache key stays the same.

How it was tested

  • In game on main (41adb55 + this change), RTX 4080, Series X profile, DLSS Performance via Streamline, 375 s Chapter 1 route: within the first seconds of the world all three new kinds were needed — textures: gray stand-in made for Line views, … for Cube views, … for Volume views — so on main these slots were null (black) while their textures streamed. The run reached the shore (373.8 s) and then ended with a host command list did not close (0x80070057); the same error ends some runs of plain main too (it appeared in 3 of 5 of our runs that reached the shore, with and without this change), and the debug layer names an out-of-bounds CopyTextureRegion into a BC7 texture (see Crash 0x80070057 host command list did not close: debug layer names CopyTextureRegion BC7_TYPELESS -> BC6H_TYPELESS (same scene every run) #2914), which this PR does not touch.
    • What to look for (any build): textures: gray stand-in made for Volume views (VICTORY_NEUTRAL_ALL_KINDS=0: a null view). There are Line and Cube versions of the same line. Each is printed once, the first time a slot of that kind is given its stand-in. If none of these lines appears, the title never had a non-2D slot waiting, and this change did nothing in that run.
    • What to look for (diagnostics build): texture slots shown a gray stand-in since the start, by kind: 2D <n> 1D <n> 3D <n> cube <n> (VICTORY_NEUTRAL_ALL_KINDS=0: 1D, 3D and cubes a null view, as before). The 1D/3D/cube counts are the slots that read black before this change.
    • A/B: the same route with VICTORY_NEUTRAL_ALL_KINDS=0, then the default, comparing the streaming moments where black blotches were seen.
  • GPU and profile: RTX 4080 16 GB, Ryzen 7 9800X3D, 32 GB RAM, Windows, Series X profile.
  • Before / after (our fork, not this branch): our fork has carried this change since its commit 66b36a12, on by default. We have no measured before/after for the blotches. Seeing them is what led us to the null-view path, but we have not tied them to it.
  • New/updated unit test: descriptor::host::tests::a_texture_not_there_yet_has_a_neutral_stand_in (VICTORY_WARP=1). It checks that 2D and 2D-array views get a stand-in, that 1D, 1D-array, 3D, cube and cube-array views get one when the switch is on (and a null view when it is off), that multisampled views never get one, and that the device is not removed after the views are made.
  • CI-equivalent commands on this branch (b4c33f1 on 41adb55; offline, --locked):
    • cargo clippy -p victory-gpu --all-targets, and the same with --all-features: exit 0, with no warning in the lines this adds. The only warning in a touched file is one already on main: method mirror_for_pass is never used (descriptor/host.rs). Clippy with -D warnings stops in victory-shader on main even without this PR (unused imports PAIR_MEETINGS and analysis::lane_regions, and while_immutable_condition).
    • VICTORY_WARP=1 cargo test -p victory-gpu --lib -- neutral: 3 passed. The same test with VICTORY_NEUTRAL_ALL_KINDS=0: passed.
    • VICTORY_WARP=1 cargo test -p victory-gpu --lib -- descriptor::: 104 passed, 2 ignored.
    • cargo xtask policy --staged: "asset policy: 2 files ok".
  • cargo test passed for the crates it touches: yes, for the tests run above. The whole workspace suite was not run. On main, every_switch_of_the_translator_is_in_the_key and a menu test fail without this PR. The new switch is read in victory-gpu, not by the translator, so it does not need to be in that test's list.

Checked for overlap

🤖 Generated with Claude Code

…of their kind, not black (VICTORY_NEUTRAL_ALL_KINDS, on)

neutral_for gave only 2D views and 2D arrays the 1x1 gray (0x80)
stand-in; 1D, 3D and cube views (and their arrays) got a null view, which
reads as zeros: black where a material samples a volume or a cube whose
texture is waiting, unmade or let go, while a 2D slot in the same state
reads gray. Now a 1-texel 1D, a 1x1x1 3D and a 1x1 six-face cube texture
of 0x80 are made once and shown through a view of the slot's own
dimension. Multisampled views and buffers keep their null views.
VICTORY_NEUTRAL_ALL_KINDS=0: a null view, as before.

Defensive: which in-game black blotches this accounts for is not yet
attributed. NEUTRAL_KINDS counts the slots given each kind of stand-in
(logged beside the VICTORY_GONE_NEUTRAL count in a diagnostics build);
any build logs once "textures: gray stand-in made for <Line|Volume|Cube>
views" when the first one is made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor

I checked the actual texel contents on Windows using app-local WARP 1.0.22 and Agility 1.620.2. The same fixture calls neutral_for and reads every subresource from the returned 1x1 resource. It checks the D3D12 resource dimension and format before recording the copies.

  • Main/release 41adb551 returned the two 2D stand-ins, both [0x80, 0x80, 0x80, 0x80]. The five new SRV dimensions had no stand-in.
  • Exact PR head b4c33f1 returned all seven stand-ins when enabled. All 17 readbacks were RGBA 0x80, including each of the six faces through the cube and cube-array cases.
  • The same PR build with VICTORY_NEUTRAL_ALL_KINDS=0 again returned only the two 2D stand-ins. Both retained the same color.

This verifies the generated fallback resources and the opt-out. Whether these slots account for the reported in-game black blotches still needs the same-route A/B.

AI-assisted with OpenAI Codex.

moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…for their texture show a gray stand-in of their kind, not black (VICTORY_NEUTRAL_ALL_KINDS))

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dyshay

dyshay commented Nov 30, 2026

Copy link
Copy Markdown

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched code pass. A run on an RTX 4090 is queued. Frame times will follow here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants