Path: blob/master/thirdparty/d3d12ma/patches/0001-mingw-support.patch
9904 views
diff --git a/thirdparty/d3d12ma/D3D12MemAlloc.cpp b/thirdparty/d3d12ma/D3D12MemAlloc.cpp1index 8e2488091a..80d910e694 1006442--- a/thirdparty/d3d12ma/D3D12MemAlloc.cpp3+++ b/thirdparty/d3d12ma/D3D12MemAlloc.cpp4@@ -33,6 +33,12 @@5#include <shared_mutex>6#endif78+#if !defined(_MSC_VER)9+#include <guiddef.h>10+11+#include <dxguids.h>12+#endif13+14////////////////////////////////////////////////////////////////////////////////15////////////////////////////////////////////////////////////////////////////////16//17@@ -8178,7 +8184,13 @@ HRESULT AllocatorPimpl::UpdateD3D12Budget()1819D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC& resourceDesc) const20{21+#if defined(_MSC_VER) || !defined(_WIN32)22return m_Device->GetResourceAllocationInfo(0, 1, &resourceDesc);23+#else24+ D3D12_RESOURCE_ALLOCATION_INFO ret;25+ m_Device->GetResourceAllocationInfo(&ret, 0, 1, &resourceDesc);26+ return ret;27+#endif28}2930#ifdef __ID3D12Device8_INTERFACE_DEFINED__31@@ -8186,7 +8198,13 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c32{33D3D12MA_ASSERT(m_Device8 != NULL);34D3D12_RESOURCE_ALLOCATION_INFO1 info1Unused;35+#if defined(_MSC_VER) || !defined(_WIN32)36return m_Device8->GetResourceAllocationInfo2(0, 1, &resourceDesc, &info1Unused);37+#else38+ D3D12_RESOURCE_ALLOCATION_INFO ret;39+ m_Device8->GetResourceAllocationInfo2(&ret, 0, 1, &resourceDesc, &info1Unused);40+ return ret;41+#endif42}43#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__44454647