GPU: limit staged constant-buffer uploads to 64 KiB #104

Open
avt0m4t48 wants to merge 2 commits from upstream-pr/104 into main
avt0m4t48 commented 2026-11-24 21:30:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-24T21:30:28Z.


Refs #72 and #24. A staged constant-buffer view uses at most 64 KiB on desktop D3D12. Limit the scratch allocation and deferred copy to those source bytes, before the existing 256-byte alignment. This also avoids copying the unused tail for the 2,785,536-byte descriptor in #72. The staged copy for that size is 2,720,000 bytes smaller. Measured frame time and title results remain open.

The size regression covers small and unaligned requests, the 64 KiB boundary, the reported size, and u32::MAX. An isolated Linux run of the exact Rust regression passed and reproduced a boundary failure without the cap. Windows-target Clippy from Linux with diagnostics and the pure Rust blake3 feature passed with warnings denied. Asset policy passed. The fork's unrelated non-Windows GPU crate compile errors block running that crate's full suite locally.

Separately, a native WARP debug-layer probe reproduced the invalid 2,785,536-byte view and accepted a 64 KiB view of the same allocation. WARP confirmation

AI-assisted using Codex. Source-built inputs only.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6591805864 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/104). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T21:30:28Z. --- Refs #72 and #24. A staged constant-buffer view uses at most 64 KiB on desktop D3D12. Limit the scratch allocation and deferred copy to those source bytes, before the existing 256-byte alignment. This also avoids copying the unused tail for the 2,785,536-byte descriptor in #72. The staged copy for that size is 2,720,000 bytes smaller. Measured frame time and title results remain open. The size regression covers small and unaligned requests, the 64 KiB boundary, the reported size, and `u32::MAX`. An isolated Linux run of the exact Rust regression passed and reproduced a boundary failure without the cap. Windows-target Clippy from Linux with diagnostics and the pure Rust `blake3` feature passed with warnings denied. Asset policy passed. The fork's unrelated non-Windows GPU crate compile errors block running that crate's full suite locally. Separately, a native WARP debug-layer probe reproduced the invalid 2,785,536-byte view and accepted a 64 KiB view of the same allocation. [WARP confirmation](https://github.com/avt0m4t48/victory-fork/actions/runs/45490999448) AI-assisted using Codex. Source-built inputs only.
avt0m4t48 commented 2026-11-25 13:06:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T12:54:18Z.


Updated this branch through main 0b0074e and reran the staged-prefix regression on Windows Server 2025. It passed at ee443cd, including the 64 KiB boundary and oversized input cases. The MSVC-target Rust check and asset policy passed. The change covers staging allocation and copying, alongside the direct descriptor work in #911. Windows run

AI-assisted.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7163018036 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/104#issuecomment-7163018036). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T12:54:18Z. --- Updated this branch through main `0b0074e` and reran the staged-prefix regression on Windows Server 2025. It passed at `ee443cd`, including the 64 KiB boundary and oversized input cases. The MSVC-target Rust check and asset policy passed. The change covers staging allocation and copying, alongside the direct descriptor work in #911. [Windows run](https://github.com/avt0m4t48/victory-fork/actions/runs/45617525314) AI-assisted.
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/104:upstream-pr/104'
git switch 'upstream-pr/104'

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/104'
git switch 'upstream-pr/104'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/104'
git switch 'upstream-pr/104'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/104'
git switch 'main'
git merge --squash 'upstream-pr/104'
git switch 'main'
git merge --ff-only 'upstream-pr/104'
git switch 'main'
git merge 'upstream-pr/104'
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!104
No description provided.