[NVIDIA / D3D12] Command list fails to close with E_INVALIDARG (0x80070057) due to invalid ResourceBarrier flags #13

Open
opened 2026-11-26 03:33:06 +00:00 by github-bot · 1 comment
Owner

@⁠domainawareness420-beep on GitHub · 2026-11-25 11:52 UTC · original

Description

When running the title on an NVIDIA GPU, the host command list fails to close during world loading (frame ~10465–10538) with:
victory_gpu::host: a host command list did not close (0x80070057): a command recorded into it was invalid

Running with VICTORY_D3D12_DEBUG=1 reveals the exact D3D12 debug layer error:
D3D12: ID3D12GraphicsCommandList::ResourceBarrier: Missing resource bind flags. id=523 severity=1

(Note: Running with VICTORY_D3D12_WARP=1 passes this point without crashing, confirming it is a strict NVIDIA D3D12 validation issue).

Environment

  • CPU: AMD Ryzen 7 9800X3D
  • GPU: [5070ti]
  • OS: Windows 11 (Build 26200)
  • Title version: 1.0.2.1 (--console series-s)

Partial Fix / Root Cause

In crates/victory-gpu/src/list.rs inside host_barrier(), wanted is sanitized via crate::host::legal_state(texture, wanted), but before is passed directly without sanitization (and identical before/after states after masking are not filtered out).

Sanitizing both before and wanted with legal_state (and skipping no-op transitions where before_legal == after_legal) fixes the id=523 barrier crash and allows the game to progress further (up to frame=11032, where another 0x80070057 occurs):

let before_legal = crate::host::legal_state(texture, before);
let after_legal = crate::host::legal_state(texture, wanted);
if before_legal == after_legal {
    return None;
}
Some(Barrier {
    kind: 0,
    flags: 0,
    first: texture.as_raw().cast_const().cast(),
    second: 0xffff_ffff | (u64::from(before_legal) << 32),
    last: u64::from(after_legal),
})
**@⁠domainawareness420-beep** on GitHub · 2026-11-25 11:52 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/13) ### Description When running the title on an NVIDIA GPU, the host command list fails to close during world loading (`frame ~10465`–`10538`) with: `victory_gpu::host: a host command list did not close (0x80070057): a command recorded into it was invalid` Running with `VICTORY_D3D12_DEBUG=1` reveals the exact D3D12 debug layer error: `D3D12: ID3D12GraphicsCommandList::ResourceBarrier: Missing resource bind flags. id=523 severity=1` *(Note: Running with `VICTORY_D3D12_WARP=1` passes this point without crashing, confirming it is a strict NVIDIA D3D12 validation issue).* ### Environment - **CPU:** AMD Ryzen 7 9800X3D - **GPU:** [5070ti] - **OS:** Windows 11 (Build 26200) - **Title version:** 1.0.2.1 (`--console series-s`) ### Partial Fix / Root Cause In `crates/victory-gpu/src/list.rs` inside `host_barrier()`, `wanted` is sanitized via `crate::host::legal_state(texture, wanted)`, but `before` is passed directly without sanitization (and identical before/after states after masking are not filtered out). Sanitizing both `before` and `wanted` with `legal_state` (and skipping no-op transitions where `before_legal == after_legal`) fixes the `id=523` barrier crash and allows the game to progress further (up to `frame=11032`, where another `0x80070057` occurs): ```rust let before_legal = crate::host::legal_state(texture, before); let after_legal = crate::host::legal_state(texture, wanted); if before_legal == after_legal { return None; } Some(Barrier { kind: 0, flags: 0, first: texture.as_raw().cast_const().cast(), second: 0xffff_ffff | (u64::from(before_legal) << 32), last: u64::from(after_legal), }) ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:33:06 +00:00
Author
Owner

@⁠WuDiXiaoBo on GitHub · 2026-11-25 12:31 UTC · original

Applied your legal_state patch on a different NVIDIA card (RTX 4060 Ti 16 GB): the world stops being black and becomes visible, with the colour still wrong

I hit the "world loads but every frame is black" state on this fork (#15, with before-captures: mean R+G+B 0.00 across the whole presented image), read your diagnosis in this issue and applied your patch by hand to crates/victory-gpu/src/list.rs (host_barrier, kind 0): both sides of a transition through legal_state, and a transition whose legal states match dropped instead of recorded.

Result: the black screen is gone. Same machine, same save, same build otherwise, fresh cache:

before the patch with your patch
world loads yes (draws 200-1,800, 23.2 GB, no crash) yes
presented image pure black - mean R+G+B 0.00, max 0, 0 of 42,625 sampled pixels non-zero visible geometry - the character's silhouette against a grey sky with red clouds, ground lit white
captured frame 6 KB, all zero 150 KB, mean R+G+B 659.6, 90.8 % of sampled pixels above 30 (overexposed)
frame time 0.4-1.4 fps 0.7-2.2 fps (448-1,349 ms a frame, GPU 280-687 ms)

So on this card the patch does not change the frame rate but it changes what is broken: from "nothing is composed" to "the scene is composed and badly shaded". That is a much better failure to debug, and worth having in the tree even before the rest is fixed.

Two things that did not reproduce here, so you know what the patch was and was not doing on this card

  • No a host command list did not close / ResourceBarrier: Missing resource bind flags line appeared before the patch either, in any of the runs. Whatever the patch fixed for me, it was silent here.
  • The view heap shortfall is unchanged: host view heap capped at 1000000 ... wanted=1245184 made=934464 lost=310720 and a view heap shorter than shaders keep their indices in still print, so that is not the black image either, as you suspected.

What is still wrong (in case it is the same shape as the next thing you hit at frame 11032): the colours are not merely "no light in shadow" - the sky's clouds are saturated red, the ground is blown out to white, and the whole image is overexposed. If that is the title's tone mapping reading a buffer that a pass has not filled yet, then it may be one more barrier/state problem on a different path, and I can run whatever you want measured on this card (any VICTORY_* switch, a capture of a named target, VICTORY_D3D12_DEBUG=1 for the info-queue text).

My report, with the before-patch captures and the log, is #15. I can post the after-patch screenshot and log here too if useful - they are 2.6 MB and 3.9 MB.

Environment: RTX 4060 Ti 16 GB, driver 32.0.16.2114, i5-12400 (6C/12T), 31.8 GB, Windows 11 build 26300, Series X profile, fork 4cbe9d7, diag build, save = the prologue checkpoint.

AI-assisted: the runs, the captures and this text were produced with DeepSeek Harness (DeepSeek-V4-Flash) on my machine, at my request. No game data included.

patched-live-world-silhouette

patched-run.log

**@⁠WuDiXiaoBo** on GitHub · 2026-11-25 12:31 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/13#issuecomment-7162500943) Applied your `legal_state` patch on a different NVIDIA card (RTX 4060 Ti 16 GB): the world stops being black and becomes visible, with the colour still wrong I hit the "world loads but every frame is black" state on this fork (`#15`, with before-captures: mean R+G+B 0.00 across the whole presented image), read your diagnosis in this issue and applied your patch by hand to `crates/victory-gpu/src/list.rs` (`host_barrier`, kind 0): both sides of a transition through `legal_state`, and a transition whose legal states match dropped instead of recorded. **Result: the black screen is gone.** Same machine, same save, same build otherwise, fresh cache: | | before the patch | with your patch | |---|---|---| | world loads | yes (draws 200-1,800, 23.2 GB, no crash) | yes | | presented image | **pure black** - mean R+G+B 0.00, max 0, 0 of 42,625 sampled pixels non-zero | **visible geometry** - the character's silhouette against a grey sky with red clouds, ground lit white | | captured frame | 6 KB, all zero | 150 KB, mean R+G+B 659.6, 90.8 % of sampled pixels above 30 (overexposed) | | frame time | 0.4-1.4 fps | 0.7-2.2 fps (448-1,349 ms a frame, GPU 280-687 ms) | So on this card the patch does not change the frame rate but it changes *what* is broken: from "nothing is composed" to "the scene is composed and badly shaded". That is a much better failure to debug, and worth having in the tree even before the rest is fixed. **Two things that did not reproduce here, so you know what the patch was and was not doing on this card** - No `a host command list did not close` / `ResourceBarrier: Missing resource bind flags` line appeared before the patch either, in any of the runs. Whatever the patch fixed for me, it was silent here. - The view heap shortfall is unchanged: `host view heap capped at 1000000 ... wanted=1245184 made=934464 lost=310720` and `a view heap shorter than shaders keep their indices in` still print, so that is not the black image either, as you suspected. **What is still wrong** (in case it is the same shape as the next thing you hit at frame 11032): the colours are not merely "no light in shadow" - the sky's clouds are saturated red, the ground is blown out to white, and the whole image is overexposed. If that is the title's tone mapping reading a buffer that a pass has not filled yet, then it may be one more barrier/state problem on a different path, and I can run whatever you want measured on this card (any `VICTORY_*` switch, a capture of a named target, `VICTORY_D3D12_DEBUG=1` for the info-queue text). My report, with the before-patch captures and the log, is #15. I can post the after-patch screenshot and log here too if useful - they are 2.6 MB and 3.9 MB. Environment: RTX 4060 Ti 16 GB, driver 32.0.16.2114, i5-12400 (6C/12T), 31.8 GB, Windows 11 build 26300, Series X profile, fork `4cbe9d7`, diag build, save = the prologue checkpoint. *AI-assisted: the runs, the captures and this text were produced with DeepSeek Harness (DeepSeek-V4-Flash) on my machine, at my request. No game data included.* <img width="2560" height="1440" alt="patched-live-world-silhouette" src="https://github.com/user-attachments/assets/b852bcad-4341-4c44-bbd4-a80c5f3858af" /> [patched-run.log](https://github.com/user-attachments/files/35411380/patched-run.log)
This discussion has been locked. Commenting is limited to contributors.
No description provided.