D3D12.X: allocation info of several resources is padded to their alignment #1354
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1354
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1354/head"
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?
@emirduran707 on GitHub · 2026-11-24 15:08 UTC · original
emirduran707:d3d12x-allocation-info-alignment→main· +55 −21 · 1 files · 1 commits · merged 2026-11-24 15:57 UTCGetResourceAllocationInfo(#25) andGetResourceAllocationInfo1(#108) for several resources summed their sizes with each one aligned, but did not pad the total to the largest alignment. Microsoft's documentation says "the C++ algorithm for calculating a structure size and alignment are used". With a 4 MB-aligned resource between two 64 KB-aligned ones the total is 12 MB, and otherwise 8 MB. XCL answered 8 MB + 64 KB and 4 MB + 128 KB.The arithmetic of both is now one function,
allocation_of, which pads the total to the largest alignment when there is more than one resource. The per-resource offsets that #108 writes are unchanged. A single resource is unchanged too: XG's texture sizes are not always a multiple of their alignment, and padding them would change every single-texture answer.What is in it
crates/xcl/src/hle/d3d12x/device_x.rs:allocation_of, used by #25 and #108; testallocation_info_of_several_is_padded_to_the_largest_alignment. It covers [64K, 4M, 64K] → 12M, [4M, 64K, 64K] → 8M, [64K, 64K, 4M] → 8M, a single resource unchanged, and nothing placed after a failed resource.Tested
cargo test --workspace -- --test-threads=4on60e7603: 752 passed, 0 failed, 41 ignored; no SKIPPED GPU testsleft: (8454144, 4194304),right: (12582912, 4194304); with the change it passesRegression run
main:
this PR:
Not tested
SizeInBytesand places a 4 MB-aligned resource after them; the smoke title's run is a regression check only.AI use
🤖 Generated with Claude Code
@futurepro62 on GitHub · 2026-11-24 15:16 UTC · original · edited 2026-11-24 15:21 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
60e7603(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.allocation_info_of_several_is_padded_to_the_largest_alignment.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use