Repository navigation
GPU: refresh a texture alias after its source is written again - #2341
andrewpozdnakov7-jpg wants to merge 2 commits into
Conversation
Cache an alias by the source texture and its last write in the command list. A write-capable use invalidates that record even after another read changes the source state. Exercise both GPU writes and read the placed alias twice in a single WARP submission.
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Refreshing a texture alias when its source is written again in the same command list cleanly prevents stale placed reads after subsequent GPU writes.
cargo test -p victory-gpu resource::tests: 11/11 passed on RTX 5090, 11/11 passed on WARP (including live GPU testa_second_gpu_write_reaches_the_placed_alias_in_the_same_list).cargo test -p victory-gpu texture::tests: 2/2 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
|
I tested this change together with #2314 at Combined branch and test If the code or tests are folded into another commit, please add: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com AI-assisted. Synthetic tests only. |
catminou4
left a comment
There was a problem hiding this comment.
Texture alias refreshed after its source is written — TextureState tracks write_version and alias_source. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Aliasing coherence fix; ties to #2226/#2276 cluster.
|
Correction: please disregard this as evidence against this PR. Later runs of stacks without this PR showed an equally dark picture, so the single pair of runs I compared does not attribute it to this PR. I have no result for or against this change. AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Merge candidate. On your reply: the #2314 integration (the direct multisampled path also calling CI: Generated by Claude Code |
|
Updated the branch to main The source's version now controls whether to recopy. The destination's own write leaves that record in place. Full GPU suite on WARP passed with 199 passed and 1 ignored in both D3D12 debug flag settings. Strict GPU Clippy and the asset policy passed. Please preserve our Git author if taking the change or test into another branch. If folding them into another commit, please include this trailer. Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
|
I checked the direct MSAA path on a composition of main 13f91ca, #2314 at 8c8cfb4 and #2341 at 075b2ac. The combined path needs both the updated CopyResource arguments and the alias version record used by the footprint path. With the argument adjustment alone, the same WARP test resolves 0.375, then overwrites a destination-only clear of 0.625 with 0.375. With the version record, all 16 texels resolve to 0.375, then 0.625, then 0.875 after a new source write. Six paired runs across both debug settings reproduced the difference. The serial GPU suite passed 200 tests with one ignored in each setting, and strict GPU Clippy and asset policy passed. Integration commit aea413d contains the small adaptation and extended readback test above the two exact PR heads. If you fold the adaptation or test into another commit, please keep the Git attribution with: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
A placed texture alias was copied once per command list. A later GPU write to its source could leave the next alias read on older contents. Recopying after a write to the alias itself can also overwrite that newer destination data.
Keep the source host texture and its write version from the last alias copy. A write to the destination keeps that record. A new source version makes another copy necessary.
The synthetic WARP test records a red write to the R32G32_UINT source, a blue write to the BC1 alias destination, then a green write to the source. It reads the alias after each write and directly verifies the final source block.
67e8ae1401df112248aed36d0024483181b718b7075b2ac4d1c15d4902bfe231346585998ffdb2e3Full GPU suite on WARP had 199 passes and 1 ignored under both D3D12 debug flag settings. Strict GPU Clippy passed with default and all features, and the asset policy passed. AI-assisted. Test data is synthetic.
Please preserve the Git author if you cherry-pick the change. If you fold the code or regression into another commit, please include the trailer below.
Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com
Coordination claim