GPU: round fallback footprint size up to alignment #3185
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3185
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@reeledMarek on GitHub · 2026-11-26 11:28 UTC · original
reeledMarek:fix/gpu-footprint-fallback-alignment→main· +30 −1 · 1 files · 1 commits · openSummary
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.@oni-swr on GitHub · 2026-11-26 11:42 UTC · original
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.
@cloph-dsp on GitHub · 2026-11-26 11:44 UTC · original
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).@Dukestar69 on GitHub · 2026-11-26 12:08 UTC · original · approved these changes
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.