Skip to content

Commit 90a230a

Browse files
committed
Disabled usage of small alignment when tight alignment is enabled in AllocatorPimpl::GetResourceAllocationInfo
Hopefully fixes #83 - thanks @rtryan98
1 parent 2ac8a9b commit 90a230a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/D3D12MemAlloc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7849,6 +7849,7 @@ HRESULT AllocatorPimpl::GetResourceAllocationInfo(
78497849

78507850
#if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
78517851
if (inOutResourceDesc.Alignment == 0 &&
7852+
!IsTightAlignmentEnabled() &&
78527853
(inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE1D ||
78537854
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D ||
78547855
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) &&

src/D3D12Sample.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ static void PrintAdapterInformation(IDXGIAdapter1* adapter)
605605
assert(0);
606606
}
607607

608-
wprintf(L"D3D12_FEATURE_DATA_D3D12_OPTIONS16:\n");
609-
wprintf(L" GPUUploadHeapSupported = %u\n", g_Allocator->IsGPUUploadHeapSupported() ? 1 : 0);
608+
wprintf(L"GPUUploadHeapSupported = %u\n", g_Allocator->IsGPUUploadHeapSupported() ? 1 : 0);
609+
wprintf(L"TightAlignmentSupported = %u\n", g_Allocator->IsTightAlignmentSupported() ? 1 : 0);
610610

611611
ComPtr<IDXGIAdapter3> adapter3;
612612
if(SUCCEEDED(adapter->QueryInterface(IID_PPV_ARGS(&adapter3))))

0 commit comments

Comments
 (0)