Repository navigation
GPU: presenting a texture already in the copy source state makes no barrier from it to itself - #2330
denkencar-sketch wants to merge 1 commit into
Conversation
…arrier from it to itself D3D12 refuses a transition from a state to the same one.
catminou4
left a comment
There was a problem hiding this comment.
A texture already in the copy source state gets no same-state barrier (transition_if None). 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. Includes host-gated test.
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:
- Avoiding redundant resource barriers when a presented texture is already in
COPY_SOURCEcleanly prevents self-transition barriers. cargo test -p victory-gpu host::tests::: all 7/7host::tests::*passed on RTX 5090 and 7/7 on WARP (includinga_barrier_to_the_same_state_is_not_made; only the pre-existing NVIDIA #1744 baseline failure indescriptor::host::tests::dynamic_slots_are_held_until_releasedmatched the substring).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. This pull request no longer merges cleanly into Generated by Claude Code |
|
Closing as superseded: #1997 (\ |
Summary
Presenting a texture that is already in the copy source state made a barrier from that state to itself, which D3D12 refuses.
transition_ifnow makes no barrier when the before and after states are the same.Testing
Test
a_barrier_to_the_same_state_is_not_madefails with the always-barrier behaviour and passes with this change.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).This fixes only the same-state barrier. Not fixed:
queue::presentalso reads and restores the texture's host state outside thesubmittedlock, which can clobber another queue's tracked state; that needs a presenter window to test. Not tried: a run in the game.AI-assisted.