GPU: refresh an uploaded texture view from its current GPU writer #231
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!231
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-231"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@pokces on GitHub · 2026-11-26 06:49 UTC · original
pokces:fix/rx-alias-after-upload→rx9070xt· +170 −10 · 6 files · 6 commits · openAn upload from title memory can mark a placed texture view as used before the same command list samples it as an alias of a GPU-written texture. If the writer needs no state transition, the previous code skips the copy and the shader sees the uploaded bytes.
This backports kesku’s fix as integrated by fxceless at
19a45d1. The list remembers which GPU source was copied into the view and preservesHostList::usedon the RX branch. Original PR · Upstream commitVerification on the updated rx9070xt base
Merged
cd8dfc0into the PR and expanded the regression in16a218f. The PR diff touches the three GPU files for the alias fix and its test. Original implementation credit remains with kesku and fxceless.On the RX 9070 XT (Windows 11 build 26300, driver 32.0.32029.2010, Rust 1.98.1), the D3D12 test read back
0x8c020100after the first alias copy,0x12345678after a destination-only marker and a repeat of the same writer, and0x4a030201after switching to a different writer of the same format. All three assertions passed. The default GPU crate suite passed 387 tests with 34 ignored. The asset policy check passed.For the in-game check we used Series X, 1920×1080, the upstream
-Safeprofile, andVICTORY_SHADER_OPT=59. The first patched run reached the prison dorm, but two characters had missing faces in the flashback. A separate run of cleancd8dfc0rendered both faces, and a repeat on the final PR head with its cache populated also rendered both. The cause of the first-run difference remains open. This comparison does not establish a performance gain.GPT 6.2 Astra generated the expanded regression, the merge resolution and the verification notes. The GPU readbacks and game observations above were collected on physical hardware.
Earlier verification on
81ebb7bTested on Windows 11 build 26300, RX 9070 XT, driver 32.0.32029.2010, Rust 1.98.1. On
rx9070xtat81ebb7b, running the added regression test alone returned0x00000000. With the fix it passed and read back the GPU-written0x8c020100. The test generates its inputs locally.cargo xtask policypassed. This measures texture correctness.Earlier workspace CI comparison on
81ebb7b(Windows, Rust 1.98.1)I ran the three workflow commands on both the patch and its clean parent. The default GPU suite passed 327 tests and skipped 34 on each. The workspace tests then stopped in the
victory-shadertest process with Windows exception0xc0000005on both builds.Both workspace Clippy configurations fail on the parent as well. The precedence warning in
victory-formats/src/texture.rs:1346reproduces on the parent. A separate comparison of the GPU crate found identical sets of Clippy diagnostics in both configurations. The targeted D3D12 regression reported above passes on the patch.The backport notes and verification report were generated by GPT 6.2 Astra. The original texture fix is by kesku, integrated upstream by fxceless.
@gut0to on GitHub · 2026-11-26 16:23 UTC · original · reviewed
AI-assisted review. I inspected the alias-source tracking and the added D3D regression statically; I did not run tests or the game. This review suggests coverage for source identity changes.
@ -7107,0 +7113,4 @@) -> bool {let view = view.as_raw() as usize;let source = source.as_raw() as usize;self.deferred().texture_aliases.insert(view, source) != Some(source)@gut0to on GitHub · 2026-11-26 16:23 UTC · original
AI-assisted review; I did not run tests. Could a focused case verify both repeated use of the same view/source and a later different source for that view? The new regression covers the first alias after a title-memory upload, but not the source-identity behavior: a repeated source should avoid redundant copies, while a changed source should refresh the view with the newer GPU contents.
@ -7567,0 +7573,4 @@) -> bool {let view = view.as_raw() as usize;let source = source.as_raw() as usize;self.deferred().texture_aliases.insert(view, source) != Some(source)@pokces on GitHub · 2026-11-27 01:36 UTC · original
Added the same-source and changed-source cases in
16a218f. The test reads back the first writer's0x8c020100, puts a marker only in the view, and samples the same writer again on the same command list. The marker (0x12345678) survives. Switching to a second writer then yields its0x4a030201. Both writers were filled on a separate list, so a prior state transition on the new writer cannot trigger the refresh. All three GPU readbacks passed on an RX 9070 XT with Windows driver 32.0.32029.2010.The expanded regression and this verification note were generated by GPT 6.2 Astra.
@adrianmjim on GitHub · 2026-11-27 07:25 UTC · original
Tested the PR's own changes (
3933258and16a218f) on a-publier4eb6cfd, on an RX 7900 XT (RDNA3) and on WARP. Driver 32.0.32029.2010, Windows 11 26300, Rust 1.98.1, profile diag with --features diagnostics. Both commits apply cleanly; the Clippy fixes from the base merge are already on a-publier.alias_after_title_upload_copies_the_gpu_atlas_and_tracks_its_source, readbacks (first alias, same writer after the marker, second writer):
4eb6cfd+ the test only: 0x00000000, 0x12345678, 0x12345678. Fails on hardware and on WARP.4eb6cfd+ PR: 0x8c020100, 0x12345678, 0x4a030201. Passes on hardware and on WARP.Full victory-gpu lib suite, --test-threads=1, same results on hardware and on WARP:
4eb6cfd+ PR: 445 passed, 1 failed, 34 ignored.4eb6cfd: 444 passed, 1 failed, 34 ignored.Two local cases the new test does not cover, run on both builds, on hardware and on WARP. As in the test, the view sits in source A's memory in another format; there is no title upload in these cases.
Not tested:
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.