GPU: bound detiling slices to the upload allocation #987

Open
gmankab wants to merge 1 commit from upstream-pr/989 into main
gmankab commented 2026-11-25 15:14:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by gmankab on 2026-11-25T15:14:59Z.


D3D12 can omit the final row's trailing pitch padding from the size returned by GetCopyableFootprints. The texture detiler currently constructs a mutable slice as if all rows, including the last, had a full pitch of allocated bytes. The zero-fill path also writes through that slice.

Bound each subresource slice to the mapped upload allocation while preserving the row and depth pitches for detiling. An offset beyond the allocation is rejected.

Validation

  • All three victory-gpu texture tests pass on this branch under Wine, including a new test for the short last row.
  • The same fix plus a hardware test on the native Linux branch copied eight synthetic 1024×512 BC7 mip levels to the texture and read every row back on an RX 6800. The last row had no trailing pitch padding.
  • The native build still hit a world-entry GPU reset in a later run. This change fixes the CPU-side staging bounds.

Tested-on: RX 6800, Fedora Linux 45, native vkd3d-proton and Wine
Assisted-by: gpt-6.2 sol xhigh

<!-- greyfinch-sync:fxceless/victory-fork:issue:6607695307 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/989). Originally posted by [gmankab](https://github.com/gmankab) on 2026-11-25T15:14:59Z. --- D3D12 can omit the final row's trailing pitch padding from the size returned by GetCopyableFootprints. The texture detiler currently constructs a mutable slice as if all rows, including the last, had a full pitch of allocated bytes. The zero-fill path also writes through that slice. Bound each subresource slice to the mapped upload allocation while preserving the row and depth pitches for detiling. An offset beyond the allocation is rejected. Validation - All three victory-gpu texture tests pass on this branch under Wine, including a new test for the short last row. - The same fix plus a hardware test on the native Linux branch copied eight synthetic 1024×512 BC7 mip levels to the texture and read every row back on an RX 6800. The last row had no trailing pitch padding. - The native build still hit a world-entry GPU reset in a later run. This change fixes the CPU-side staging bounds. Tested-on: RX 6800, Fedora Linux 45, native vkd3d-proton and Wine Assisted-by: gpt-6.2 sol xhigh
ThomasHFWright commented 2026-11-25 19:09:44 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ThomasHFWright on 2026-11-25T18:12:12Z.


Linux/Proton validation of e72eb0318d, cherry-picked with attribution into ThomasHFWright/LinVictory.

CachyOS, Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, GE-Proton 11-14, pinned patched vkd3d-proton runtime. Added synthetic BC7 mip/array, volume and zero-fill canary coverage for short staging allocations. GPU suite: 211 passed, 4 existing Wine/runtime failures, 8 ignored. Application build and all-target/all-feature Clippy pass.

The staging-only trial reached normal but incomplete world visuals for 478.80 s, without an NVIDIA Xid, then the same existing title breakpoint. Expensive diagnostic flags were also disabled, so this is not an isolated performance claim for this patch.

Source and detailed aggregate validation: https://github.com/ThomasHFWright/LinVictory/blob/linux-edge/docs/linux-improvements.md

AI-assisted integration/testing with OpenAI Codex. No game data or raw logs attached.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7170584235 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/989#issuecomment-7170584235). Originally posted by [ThomasHFWright](https://github.com/ThomasHFWright) on 2026-11-25T18:12:12Z. --- Linux/Proton validation of e72eb0318db357921170e77bf2e70776219d0258, cherry-picked with attribution into ThomasHFWright/LinVictory. CachyOS, Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, GE-Proton 11-14, pinned patched vkd3d-proton runtime. Added synthetic BC7 mip/array, volume and zero-fill canary coverage for short staging allocations. GPU suite: 211 passed, 4 existing Wine/runtime failures, 8 ignored. Application build and all-target/all-feature Clippy pass. The staging-only trial reached normal but incomplete world visuals for 478.80 s, without an NVIDIA Xid, then the same existing title breakpoint. Expensive diagnostic flags were also disabled, so this is not an isolated performance claim for this patch. Source and detailed aggregate validation: https://github.com/ThomasHFWright/LinVictory/blob/linux-edge/docs/linux-improvements.md AI-assisted integration/testing with OpenAI Codex. No game data or raw logs attached.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/989:upstream-pr/989'
git switch 'upstream-pr/989'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/989'
git switch 'upstream-pr/989'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/989'
git switch 'upstream-pr/989'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/989'
git switch 'main'
git merge --squash 'upstream-pr/989'
git switch 'main'
git merge --ff-only 'upstream-pr/989'
git switch 'main'
git merge 'upstream-pr/989'
git push origin 'main'
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
fxceless/victory-fork!987
No description provided.