GPU: round fallback footprint size up to alignment #3183
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3185"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by reeledMarek on 2026-11-26T11:28:25Z.
Summary
crates/victory-gpu/src/resource.rs,footprint()'s fallback path (used for buffers and textures without a console layout) computedalignment = desc.alignment.max(minimum)(whereminimumis4 MiBfor MSAA resources and64 KiBotherwise) but roundedsizeup toKIB_64instead ofalignment.size < alignmentfor buffers requestingalignment > 64 KiB(e.g.,4 MiB) and for MSAA fallback textures, violating D3D12'sGetResourceAllocationInfocontract and disagreeing with the console-layout branch above (t.size.checked_next_multiple_of(alignment)?).sizeup toalignmentviabytes.checked_next_multiple_of(alignment)?.Testing
footprint_fallback_rounds_size_to_alignmentincrates/victory-gpu/src/resource.rscovering both a 4 MiB-aligned buffer and an MSAA fallback texture (fails onmain, passes with the fix).cargo test -p xtask --lockedpasses.Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T11:42:10Z.
WARP verification of #3185 at
6b5e0c00a24f3e50bc578830c8c6468606d2cb8f(software adapter only, no physical GPU; claimed in #1633).Environment: Windows 11 Pro 10.0.26200; WARP
D3D10Warp.dll10.0.26100.9818; Windows SDK 10.0.26100.0dxil.dll1.8.2502.11 /dxc.exe1.8.2502.11 (VICTORY_DXILset to it); rustc viarust-toolchain.toml(1.98.1);VICTORY_D3D12_WARP=1;CARGO_TARGET_DIRoutside the repo.Commands (head and merge-base
63bcca43, which is currentmain):cargo test -p victory-gpu --lib --locked -j 4 -- --test-threads=1cargo test -p victory-gpu --lib --locked -j 4 footprint_fallback -- --test-threads=163bcca43)6b5e0c00)resource::tests::footprint_fallback_rounds_size_to_alignmentpasses on head.Revert check: with only the fix reverted (
checked_next_multiple_of(alignment)back toKIB_64), the new test fails:left: Some(AllocationInfo { size: 65536, alignment: 4194304 }),right: size: 4194304. So the test catches the bug.Defects: none found. In the fallback path
alignmentismax(desc.alignment, 64 KiB or 4 MiB), so it is non-zero and checked as a power of two before the rounding; overflow still returnsNone. The texture-layout branch already rounded to its alignment, so the change makes the fallback consistent with it. The tests are pure size arithmetic, so WARP only supplies the surrounding crate tests.AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5). No game files, dumps, shader names or hashes were used.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T11:44:27Z.
Independent local verification of head
6b5e0c0on Windows 11, Rust 1.100.0/MSVC:cargo test --locked -p victory-gpu --lib resource::tests::footprint_fallback_rounds_size_to_alignment -- --exact— 1 passed, 0 failed.git diff --check origin/main HEAD— clean.Pure arithmetic on a synthetic
ResourceDesc; no D3D12 device or game assets used. Worktree-localCARGO_TARGET_DIR. AI-assisted (Hy4 flash).Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T12:08:51Z.
Review: APPROVED
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib resource:: -- --test-threads=1: 19/19 passed (includingfootprint_fallback_rounds_size_to_alignment).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly rounds fallback footprint sizes up to alignment.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.