-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Description
When creating resources, the allocator will add the D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT flag, independently of the resource dimension.
Because images aren't supported with tight alignment, and the allocator properly changes the provided alignment of 0 to the correct value, the following validation error appears:
ID3D12Device::GetResourceAllocationInfo2: D3D12_RESOURCE_DESC::Alignment is invalid. The value is 4096. When D3D12_RESOURCE_DESC::Flag bit for D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT is set, Alignment must be 0. [ STATE_CREATION ERROR #721: CREATERESOURCE_INVALIDALIGNMENT]
Adding a check for inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER here fixes the issue.
D3D12MemoryAllocator/src/D3D12MemAlloc.cpp
Lines 7819 to 7825 in 2ac8a9b
| if (IsTightAlignmentEnabled() && | |
| // Don't allow USE_TIGHT_ALIGNMENT together with ALLOW_CROSS_ADAPTER as there is a D3D Debug Layer error: | |
| // D3D12 ERROR: ID3D12Device::GetResourceAllocationInfo: D3D12_RESOURCE_DESC::Flag D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT will be ignored since D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER is set. [ STATE_CREATION ERROR #599: CREATERESOURCE_INVALIDMISCFLAGS] | |
| (inOutResourceDesc.Flags & D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER) == 0) | |
| { | |
| inOutResourceDesc.Flags |= D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT; | |
| } |
Metadata
Metadata
Assignees
Labels
No labels