File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7710,7 +7710,15 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo(D3D12_R
77107710 }
77117711#endif // #if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
77127712
7713- return GetResourceAllocationInfoNative (inOutResourceDesc);
7713+ D3D12_RESOURCE_ALLOCATION_INFO resAllocInfo = GetResourceAllocationInfoNative (inOutResourceDesc);
7714+
7715+ // Align up to 256 B because this is the alignment required for constant buffers.
7716+ if (inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
7717+ {
7718+ resAllocInfo.Alignment = D3D12MA_MAX (resAllocInfo.Alignment , (UINT64)D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT);
7719+ }
7720+
7721+ return resAllocInfo;
77147722}
77157723
77167724bool AllocatorPimpl::NewAllocationWithinBudget (D3D12_HEAP_TYPE heapType, UINT64 size)
You can’t perform that action at this time.
0 commit comments