Fix black world rendering by legalizing host barrier states #449

Open
github-bot wants to merge 1 commit from github-bot/gh-449 into a-publier AGit
Owner

@⁠jorgechavezxyz on GitHub · 2026-11-27 02:25 UTC · original
jorgechavezxyz:fix/host-barrier-legal-states → a-publier · +7 −2 · 1 files · 1 commits · open

Summary

Sanitize both the before and after states of host texture barriers with legal_state, and skip transitions that become no-ops after sanitizing.

Verification

  • cargo build --locked --profile diag -p victory --features diagnostics completed on Windows with an RX 7900 XT.
  • The game previously showed credits and audio over a black world. After this change, the user reported that the game rendered and ran.
  • Only the barrier fix is included. The experimental performance settings were reverted locally.

Related to #13 and #15.

**@⁠jorgechavezxyz** on GitHub · 2026-11-27 02:25 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/449) `jorgechavezxyz:fix/host-barrier-legal-states` → `a-publier` · +7 −2 · 1 files · 1 commits · open ## Summary Sanitize both the before and after states of host texture barriers with `legal_state`, and skip transitions that become no-ops after sanitizing. ## Verification - `cargo build --locked --profile diag -p victory --features diagnostics` completed on Windows with an RX 7900 XT. - The game previously showed credits and audio over a black world. After this change, the user reported that the game rendered and ran. - Only the barrier fix is included. The experimental performance settings were reverted locally. Related to #13 and #15.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:29:56 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 03:55 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At b925191: cargo test --release -p victory-gpu --lib 396 passed, 0 failed, 34 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 03:55 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/449#issuecomment-7209381618) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `b925191`: `cargo test --release -p victory-gpu --lib` 396 passed, 0 failed, 34 ignored. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠gw1337x on GitHub · 2026-11-27 04:28 UTC · original

Another RDNA 3 card, as a no-regression check: RX 7800 XT 16 GB (driver 32.0.32015.7029), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 26200 (Memory Integrity off). This setup never showed the black world, so this only says the change does no harm here.

Diagnostics builds of b925191 and its base 4eb6cfd, same boot; scripts/play.ps1 settings plus VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1, Series X profile, ray tracing off; 270 s hands-off from a Chapter I boat save; fps is the layer's 1 s figure from the window title every second.

4eb6cfd (3 runs) b925191 (1 run)
steady fps (205 s on) 28.0, 29.0, 28.0 29.0
seconds < 15 fps during cutscenes and loads (60-190 s) 12, 12, 9 8
frame / card running at 240 s 34.4 / 31.9 ms 33.9 / 31.1 ms

No device loss, peak commit 33.8 GB (base 33.5-33.7 GB), and the 241 s screenshot matches the base (one frame compared). One run of the PR.

**@⁠gw1337x** on GitHub · 2026-11-27 04:28 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/449#issuecomment-7209833099) Another RDNA 3 card, as a no-regression check: RX 7800 XT 16 GB (driver 32.0.32015.7029), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 26200 (Memory Integrity off). This setup never showed the black world, so this only says the change does no harm here. Diagnostics builds of `b925191` and its base `4eb6cfd`, same boot; `scripts/play.ps1` settings plus `VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1`, Series X profile, ray tracing off; 270 s hands-off from a Chapter I boat save; fps is the layer's 1 s figure from the window title every second. | | `4eb6cfd` (3 runs) | `b925191` (1 run) | |---|---|---| | steady fps (205 s on) | 28.0, 29.0, 28.0 | 29.0 | | seconds < 15 fps during cutscenes and loads (60-190 s) | 12, 12, 9 | 8 | | frame / card running at 240 s | 34.4 / 31.9 ms | 33.9 / 31.1 ms | No device loss, peak commit 33.8 GB (base 33.5-33.7 GB), and the 241 s screenshot matches the base (one frame compared). One run of the PR.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 06:48 UTC · original

Tested on RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, Rust 1.98.1. PR head b925191 vs a-publier 4eb6cfd, release, and the diag profile with --features diagnostics.

Code path on 4eb6cfd:

  • host_barrier gets (texture, before) only from HostList::transition (host.rs). transition already does wanted = legal_for(copy.flags(), wanted). It stores that value in the list's States map and returns Some only when the previous state differs from it.
  • settle() also applies legal_for before it stores a state. transition and settle are the only writers of that map, so before has always been through legal_for already.
  • copy.flags() is the texture's GetDesc().Flags, cached in HostTexture::new / new_tiled. legal_for only clears bits, so applying it a second time changes nothing.
  • So with this PR, legal_state(texture, before) == before, and legal_state(texture, wanted) is the value 4eb6cfd already passes as last. Also, before_legal != after_legal whenever transition returns Some, so the new early return does not fire. The recorded barriers are the same as on 4eb6cfd.

Tests:

  • victory-gpu lib tests, release: 396 passed, 0 failed, 34 ignored on both sides, with no per-test difference.
  • diag + diagnostics, 3 runs per side: 444 passed, 1 failed, 34 ignored on both. The failure (timeline::report::tests::real_waits_are_recorded_with_who_ended_them) also fails on 4eb6cfd.
  • I built a release version with a counter on the new lines. No lib test reaches them (0 hits), so these tests do not cover this change either way.

The description says the experimental performance settings were reverted locally. It does not say whether the black-world run and the working run used the same settings. Logs from runs with and without this patch, on the same commit and settings, would show whether the barriers are what changed.

Not tested: the game; the D3D12 debug layer (not installed).

**@⁠adrianmjim** on GitHub · 2026-11-27 06:48 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/449#issuecomment-7211870276) Tested on RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, Rust 1.98.1. PR head b925191 vs a-publier 4eb6cfd, release, and the diag profile with --features diagnostics. Code path on 4eb6cfd: - host_barrier gets (texture, before) only from HostList::transition (host.rs). transition already does `wanted = legal_for(copy.flags(), wanted)`. It stores that value in the list's States map and returns Some only when the previous state differs from it. - settle() also applies legal_for before it stores a state. transition and settle are the only writers of that map, so `before` has always been through legal_for already. - copy.flags() is the texture's GetDesc().Flags, cached in HostTexture::new / new_tiled. legal_for only clears bits, so applying it a second time changes nothing. - So with this PR, legal_state(texture, before) == before, and legal_state(texture, wanted) is the value 4eb6cfd already passes as `last`. Also, before_legal != after_legal whenever transition returns Some, so the new early return does not fire. The recorded barriers are the same as on 4eb6cfd. Tests: - victory-gpu lib tests, release: 396 passed, 0 failed, 34 ignored on both sides, with no per-test difference. - diag + diagnostics, 3 runs per side: 444 passed, 1 failed, 34 ignored on both. The failure (timeline::report::tests::real_waits_are_recorded_with_who_ended_them) also fails on 4eb6cfd. - I built a release version with a counter on the new lines. No lib test reaches them (0 hits), so these tests do not cover this change either way. The description says the experimental performance settings were reverted locally. It does not say whether the black-world run and the working run used the same settings. Logs from runs with and without this patch, on the same commit and settings, would show whether the barriers are what changed. Not tested: the game; the D3D12 debug layer (not installed).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/449/head:github-bot/gh-449'
git switch 'github-bot/gh-449'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-449'
git switch 'github-bot/gh-449'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-449'
git switch 'github-bot/gh-449'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-449'
git switch 'a-publier'
git merge --squash 'github-bot/gh-449'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-449'
git switch 'a-publier'
git merge 'github-bot/gh-449'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.