GPU: use the host upload path for texture staging copies #680

Merged
EatCodeSleep2 merged 1 commit from upstream-pr/680 into main 2026-11-24 08:21:51 +00:00
EatCodeSleep2 commented 2026-11-24 06:43:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by EatCodeSleep2 on 2026-11-24T06:43:43Z.


Summary

Fixes #128.

CopyTextureRegion now queues the list-owned D3D12 staging buffer through defer_fill. On Wine/vkd3d-proton, the title-memory copy path can skip this upload because VirtualQuery reports the host mapping as MEM_FREE. Using the existing host-upload path keeps the destination checks for actual writes to title memory in place.

Verification

  • Windows 11: cargo test --locked -p victory-gpu --lib resource::tests::buffer_data_reaches_the_host_texture -- --exact --nocapture passed.
  • Windows 11: Ran all 44 tests in the same victory-gpu library test binary with --test-threads=1. 43 passed and one benchmark was ignored.
  • Wine/vkd3d-proton verification is pending. No game files were used for these tests.

AI-assisted implementation and verification with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576241557 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/680). Originally posted by [EatCodeSleep2](https://github.com/EatCodeSleep2) on 2026-11-24T06:43:43Z. --- ## Summary Fixes #128. `CopyTextureRegion` now queues the list-owned D3D12 staging buffer through `defer_fill`. On Wine/vkd3d-proton, the title-memory copy path can skip this upload because `VirtualQuery` reports the host mapping as `MEM_FREE`. Using the existing host-upload path keeps the destination checks for actual writes to title memory in place. ## Verification - Windows 11: `cargo test --locked -p victory-gpu --lib resource::tests::buffer_data_reaches_the_host_texture -- --exact --nocapture` passed. - Windows 11: Ran all 44 tests in the same `victory-gpu` library test binary with `--test-threads=1`. 43 passed and one benchmark was ignored. - Wine/vkd3d-proton verification is pending. No game files were used for these tests. AI-assisted implementation and verification with Codex.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:46:26Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. cargo test -p victory-gpu passed cleanly (43 passed, 1 benchmark ignored), including uffer_data_reaches_the_host_texture. Using defer_fill for staging uploads bypasses erroneous MEM_FREE reporting on Wine/vkd3d-proton while maintaining valid texture uploads.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034826461 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/680#pullrequestreview-6034826461). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:46:26Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. cargo test -p victory-gpu passed cleanly (43 passed, 1 benchmark ignored), including uffer_data_reaches_the_host_texture. Using defer_fill for staging uploads bypasses erroneous MEM_FREE reporting on Wine/vkd3d-proton while maintaining valid texture uploads.
catminou4 commented 2026-11-24 07:01:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:55:00Z.

Review: COMMENTED


Static review only (Windows/D3D12 code, no macOS verification possible):

  • HostList::defer_fill(dst, src, len) exists on main with the same signature as defer_copy; the only difference is the queued Step::Fill vs Step::Copy, i.e. which submit-time path reads the source bytes.
  • The change is 2 lines plus a clear comment; the Wine/vkd3d-proton VirtualQuery → MEM_FREE explanation for skipping the title-memory read is plausible and matches the symptom (staging silently never filled).
  • Fixes #128 as claimed.

Can't verify the submit-time behavior of Step::Fill vs Step::Copy without reading the executor; if Fill is the path used for other title-memory uploads that are known-good on Proton, this looks like the right reuse.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034923986 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/680#pullrequestreview-6034923986). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:55:00Z. **Review:** COMMENTED --- Static review only (Windows/D3D12 code, no macOS verification possible): - `HostList::defer_fill(dst, src, len)` exists on main with the same signature as `defer_copy`; the only difference is the queued `Step::Fill` vs `Step::Copy`, i.e. which submit-time path reads the source bytes. - The change is 2 lines plus a clear comment; the Wine/vkd3d-proton `VirtualQuery` → `MEM_FREE` explanation for skipping the title-memory read is plausible and matches the symptom (staging silently never filled). - Fixes #128 as claimed. Can't verify the submit-time behavior of `Step::Fill` vs `Step::Copy` without reading the executor; if `Fill` is the path used for other title-memory uploads that are known-good on Proton, this looks like the right reuse.
upstream-sync closed this pull request 2026-11-24 09:05:55 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!680
No description provided.