Repository navigation
1D, 3D and cube slots waiting for their texture show a gray stand-in of their kind, not black (VICTORY_NEUTRAL_ALL_KINDS) - #3780
Conversation
…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>
|
I checked the actual texel contents on Windows using app-local WARP 1.0.22 and Agility 1.620.2. The same fixture calls
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. |
…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>
|
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch |
[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.rsneutral_forgives 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 getsnull_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:
neutral()intoneutral_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 areR8G8B8A8_UNORM0x80 with one level, and are uploaded the way the 2D one already is (a copy queue,crate::host::before_send, a fence wait).neutral_forgive 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.VICTORY_NEUTRAL_ALL_KINDS, which is on by default.=0keeps only 2D views and arrays, which is what happens now.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 theVICTORY_GONE_NEUTRALcount incopystat::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) andcrates/victory-gpu/src/copystat.rs(one log line). Nothing invictory-shaderorshader_cache.rschanges, so the shader cache key stays the same.How it was tested
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 onmainthese slots were null (black) while their textures streamed. The run reached the shore (373.8 s) and then ended witha host command list did not close (0x80070057); the same error ends some runs of plainmaintoo (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-boundsCopyTextureRegioninto 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.textures: gray stand-in made for Volume views (VICTORY_NEUTRAL_ALL_KINDS=0: a null view). There areLineandCubeversions 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.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.VICTORY_NEUTRAL_ALL_KINDS=0, then the default, comparing the streaming moments where black blotches were seen.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.--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 onmain:method mirror_for_pass is never used(descriptor/host.rs). Clippy with-D warningsstops invictory-shaderonmaineven without this PR (unused importsPAIR_MEETINGSandanalysis::lane_regions, andwhile_immutable_condition).VICTORY_WARP=1 cargo test -p victory-gpu --lib -- neutral: 3 passed. The same test withVICTORY_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 testpassed for the crates it touches: yes, for the tests run above. The whole workspace suite was not run. Onmain,every_switch_of_the_translator_is_in_the_keyand a menu test fail without this PR. The new switch is read invictory-gpu, not by the translator, so it does not need to be in that test's list.Checked for overlap
main(41adb55),neutral_forhas stand-ins only for 2D views (TEXTURE2D) and 2D arrays (TEXTURE2D_ARRAY). Every other dimension goes tonull_for. Its test asserts that cube (9) and 3D (8) views getNone.STOOD_INcounter inneutral_for, plus a per-frame "glitch line". It does not add stand-ins of other kinds. If both are merged,STOOD_INis the sum ofNEUTRAL_KINDS.VICTORY_GONE_NEUTRAL) sends streamed-out slots throughneutral_for. This change extends that path to non-2D slots with nothing more needed.neutral_probethat usesTEXTURE3Dfor a different purpose (probe lighting). It does not overlap.neutral_for's dimensions.🤖 Generated with Claude Code