Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/D3D12MemAlloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ static const D3D12_HEAP_FLAGS RESOURCE_CLASS_HEAP_FLAGS =
static const D3D12_RESIDENCY_PRIORITY D3D12_RESIDENCY_PRIORITY_NONE = D3D12_RESIDENCY_PRIORITY(0);

static const D3D12_HEAP_TYPE D3D12_HEAP_TYPE_GPU_UPLOAD_COPY = (D3D12_HEAP_TYPE)5;
static const D3D12_RESOURCE_FLAGS D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT_COPY = (D3D12_RESOURCE_FLAGS)0x400;

#ifndef _D3D12MA_ENUM_DECLARATIONS

Expand Down Expand Up @@ -816,11 +817,9 @@ static bool ValidateAllocateMemoryParameters(
return pAllocDesc &&
pAllocInfo &&
ppAllocation &&
(pAllocInfo->Alignment == 0 ||
pAllocInfo->Alignment == D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT ||
pAllocInfo->Alignment == D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT) &&
pAllocInfo->SizeInBytes != 0 &&
pAllocInfo->SizeInBytes % (64ull * 1024) == 0;
IsPow2(pAllocInfo->Alignment) &&
pAllocInfo->SizeInBytes > 0 &&
pAllocInfo->SizeInBytes % 4 == 0;
}

#endif // _D3D12MA_FUNCTIONS
Expand Down Expand Up @@ -7849,6 +7848,7 @@ HRESULT AllocatorPimpl::GetResourceAllocationInfo(

#if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
if (inOutResourceDesc.Alignment == 0 &&
(inOutResourceDesc.Flags & D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT_COPY) == 0 &&
(inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE1D ||
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D ||
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) &&
Expand Down Expand Up @@ -9878,7 +9878,7 @@ HRESULT Allocator::AllocateMemory(
return E_INVALIDARG;
}
D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK
return m_Pimpl->AllocateMemory(pAllocDesc, pAllocInfo, ppAllocation);
return m_Pimpl->AllocateMemory(pAllocDesc, pAllocInfo, ppAllocation);
}

HRESULT Allocator::CreateAliasingResource(
Expand Down
4 changes: 2 additions & 2 deletions src/D3D12Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ static void PrintAdapterInformation(IDXGIAdapter1* adapter)
assert(0);
}

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

ComPtr<IDXGIAdapter3> adapter3;
if(SUCCEEDED(adapter->QueryInterface(IID_PPV_ARGS(&adapter3))))
Expand Down