Skip to content

Commit cea8c63

Browse files
committed
Improved logic in AllocatorPimpl::GetResourceAllocationInfo
See #83
1 parent 90a230a commit cea8c63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/D3D12MemAlloc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ static const D3D12_HEAP_FLAGS RESOURCE_CLASS_HEAP_FLAGS =
215215
static const D3D12_RESIDENCY_PRIORITY D3D12_RESIDENCY_PRIORITY_NONE = D3D12_RESIDENCY_PRIORITY(0);
216216

217217
static const D3D12_HEAP_TYPE D3D12_HEAP_TYPE_GPU_UPLOAD_COPY = (D3D12_HEAP_TYPE)5;
218+
static const D3D12_RESOURCE_FLAGS D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT_COPY = (D3D12_RESOURCE_FLAGS)0x400;
218219

219220
#ifndef _D3D12MA_ENUM_DECLARATIONS
220221

@@ -7849,7 +7850,7 @@ HRESULT AllocatorPimpl::GetResourceAllocationInfo(
78497850

78507851
#if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
78517852
if (inOutResourceDesc.Alignment == 0 &&
7852-
!IsTightAlignmentEnabled() &&
7853+
(inOutResourceDesc.Flags & D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT_COPY) == 0 &&
78537854
(inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE1D ||
78547855
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D ||
78557856
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) &&

0 commit comments

Comments
 (0)