Skip to content

Commit 8ebd258

Browse files
Added missing usage of GetResourceAllocationInfo3
Needed for cases when pCastableFormats are used. ID3D12Device12 is needed in these cases. Fixes #62.
1 parent cde7b7f commit 8ebd258

File tree

3 files changed

+210
-56
lines changed

3 files changed

+210
-56
lines changed

include/D3D12MemAlloc.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,13 +1268,14 @@ class D3D12MA_API Allocator : public IUnknownImpl
12681268
It internally uses `ID3D12Device10::CreateCommittedResource3` or `ID3D12Device10::CreatePlacedResource2`.
12691269
12701270
To work correctly, `ID3D12Device10` interface must be available in the current system. Otherwise, `E_NOINTERFACE` is returned.
1271+
If you use `pCastableFormats`, `ID3D12Device12` must albo be available.
12711272
*/
12721273
HRESULT CreateResource3(const ALLOCATION_DESC* pAllocDesc,
12731274
const D3D12_RESOURCE_DESC1* pResourceDesc,
12741275
D3D12_BARRIER_LAYOUT InitialLayout,
12751276
const D3D12_CLEAR_VALUE* pOptimizedClearValue,
12761277
UINT32 NumCastableFormats,
1277-
DXGI_FORMAT* pCastableFormats,
1278+
const DXGI_FORMAT* pCastableFormats,
12781279
Allocation** ppAllocation,
12791280
REFIID riidResource,
12801281
void** ppvResource);
@@ -1353,19 +1354,20 @@ class D3D12MA_API Allocator : public IUnknownImpl
13531354

13541355
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
13551356
/** \brief Similar to Allocator::CreateAliasingResource1, but there are initial layout instead of state and
1356-
castable formats list
1357+
castable formats list.
13571358
13581359
It internally uses `ID3D12Device10::CreatePlacedResource2`.
13591360
13601361
To work correctly, `ID3D12Device10` interface must be available in the current system. Otherwise, `E_NOINTERFACE` is returned.
1362+
If you use `pCastableFormats`, `ID3D12Device12` must albo be available.
13611363
*/
13621364
HRESULT CreateAliasingResource2(Allocation* pAllocation,
13631365
UINT64 AllocationLocalOffset,
13641366
const D3D12_RESOURCE_DESC1* pResourceDesc,
13651367
D3D12_BARRIER_LAYOUT InitialLayout,
13661368
const D3D12_CLEAR_VALUE* pOptimizedClearValue,
13671369
UINT32 NumCastableFormats,
1368-
DXGI_FORMAT* pCastableFormats,
1370+
const DXGI_FORMAT* pCastableFormats,
13691371
REFIID riidResource,
13701372
void** ppvResource);
13711373
#endif // #ifdef __ID3D12Device10_INTERFACE_DEFINED__

0 commit comments

Comments
 (0)