Repository navigation
📐 d3d12: Respect a requested resource alignment above the reported one - #321
Merged
Merged
Conversation
With D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT, a non-zero Alignment in the resource desc is a floor that CreatePlacedResource enforces, but GetResourceAllocationInfo keeps reporting the driver's (smaller) tight alignment. Sub-allocating at that alignment makes CreatePlacedResource fail with E_INVALIDARG, so allocate at the larger of the two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WN9aBMjKHQG11Ekr2ojyLe
manon-traverse
force-pushed
the
d3d12-respect-resource-alignment
branch
from
November 18, 2026 15:33
a959113 to
d3daa48
Compare
manon-traverse
requested review from
EmilioLaiso,
Jasper-Bekkers,
MarijnS95,
jasperdewinther and
maxded
November 18, 2026 15:37
Jasper-Bekkers
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT(Agility SDK 1.619.4+), a non-zeroAlignmentin the resource desc is a floor thatCreatePlacedResourceenforces, butGetResourceAllocationInfokeeps reporting the driver's own tight alignment. On an RX 7900 XTX that's 8 bytes for every buffer.create_resource()sub-allocated at that 8-byte alignment, so creating a buffer with a 16-byte floor failed:This allocates at
max(GetResourceAllocationInfo().Alignment, desc.Alignment), both increate_resource()and inAllocationCreateDesc::from_d3d12_resource_desc(). Without tight alignment, a non-zeroAlignmentis already one of the alignmentsGetResourceAllocationInforeports, so nothing changes there.Evidence
Breda's DX12 backend with tight-aligned buffers (16/64/256-byte floors per usage) on an RX 7900 XTX (Adrenalin 32.0.32015.2008) and an RTX 2080 Ti (610.88), Agility SDK 1.619.6:
E_INVALIDARGUsed by the breda PR that enables tight alignment, through the
d3d12-respect-resource-alignment-ash-nextbranch (this commit cherry-picked onto theexternal-memory-allocation-ash-nextrev that breda pins).🤖 Generated with Claude Code
https://claude.ai/code/session_01WN9aBMjKHQG11Ekr2ojyLe