Skip to content

GPU: presenting a texture already in the copy source state makes no barrier from it to itself - #2330

Closed
denkencar-sketch wants to merge 1 commit into
Marvisak:mainfrom
denkencar-sketch:fix/queue-001
Closed

denkencar-sketch wants to merge 1 commit into
Marvisak:mainfrom
denkencar-sketch:fix/queue-001

Conversation

@denkencar-sketch

Copy link
Copy Markdown
Contributor

Summary

Presenting a texture that is already in the copy source state made a barrier from that state to itself, which D3D12 refuses. transition_if now makes no barrier when the before and after states are the same.

Testing

Test a_barrier_to_the_same_state_is_not_made fails with the always-barrier behaviour and passes with this change.

cargo test --workspace --locked passes apart from known flakes: modules::dstorage::tests::a_page_list_filled_after_its_request_starts fails now and then on main too, and so does a parallel-run flake in victory-gpu's lib tests (watch:: and descriptor::host:: tests, 2 of 40 runs on pristine main).

This fixes only the same-state barrier. Not fixed: queue::present also reads and restores the texture's host state outside the submitted lock, which can clobber another queue's tracked state; that needs a presenter window to test. Not tried: a run in the game.

AI-assisted.

…arrier from it to itself

D3D12 refuses a transition from a state to the same one.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SOURCE cleanly prevents self-transition barriers.
  • cargo test -p victory-gpu host::tests::: all 7/7 host::tests::* passed on RTX 5090 and 7/7 on WARP (including a_barrier_to_the_same_state_is_not_made; only the pre-existing NVIDIA #1744 baseline failure in descriptor::host::tests::dynamic_slots_are_held_until_released matched the substring).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-gpu/src/host.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (merge-candidate) was for an older state of main.


Generated by Claude Code

@denkencar-sketch

Copy link
Copy Markdown
Contributor Author

Closing as superseded: #1997 (\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants