diff --git a/ports/d3d12-memory-allocator/0001-output-dirs.patch b/ports/d3d12-memory-allocator/0001-output-dirs.patch new file mode 100644 index 0000000000..47d1d8f2d9 --- /dev/null +++ b/ports/d3d12-memory-allocator/0001-output-dirs.patch @@ -0,0 +1,30 @@ +diff --git a/configure b/configure +index 1f0b9497cb..3243e23021 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -40,8 +40,12 @@ D3D12MA_IMPORTS + ) + endif() + +-install(TARGETS D3D12MemoryAllocator DESTINATION "lib") ++install(TARGETS D3D12MemoryAllocator EXPORT d3d12-memory-allocator-config ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}") + install(FILES "${PROJECT_SOURCE_DIR}/include/D3D12MemAlloc.h" DESTINATION "include") + + if(D3D12MA_BUILD_SAMPLE) + if(WIN32) +@@ -126,3 +130,11 @@ else() + message(STATUS "D3D12Sample application is not supported to Linux") + endif() + endif() ++ ++target_include_directories(D3D12MemoryAllocator PUBLIC $ $) ++set_target_properties(D3D12MemoryAllocator PROPERTIES PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/include/D3D12MemAlloc.h") ++ ++install( ++ EXPORT d3d12-memory-allocator-config DESTINATION cmake/ ++ NAMESPACE "unofficial::" ++) diff --git a/ports/d3d12-memory-allocator/0002-Fix-32b-compilation.patch b/ports/d3d12-memory-allocator/0002-Fix-32b-compilation.patch new file mode 100644 index 0000000000..dcdd73d49b --- /dev/null +++ b/ports/d3d12-memory-allocator/0002-Fix-32b-compilation.patch @@ -0,0 +1,20 @@ +diff --git a/src/D3D12MemAlloc.cpp b/src/D3D12MemAlloc.cpp +index 2555ef6..e2d444e 100644 +--- a/src/D3D12MemAlloc.cpp ++++ b/src/D3D12MemAlloc.cpp +@@ -7181,11 +7181,11 @@ void AllocatorPimpl::BuildStatsString(WCHAR** ppStatsString, BOOL detailedMap) + json.WriteString(m_AdapterDesc.Description); + + json.WriteString(L"DedicatedVideoMemory"); +- json.WriteNumber(m_AdapterDesc.DedicatedVideoMemory); ++ json.WriteNumber((UINT64)m_AdapterDesc.DedicatedVideoMemory); + json.WriteString(L"DedicatedSystemMemory"); +- json.WriteNumber(m_AdapterDesc.DedicatedSystemMemory); ++ json.WriteNumber((UINT64)m_AdapterDesc.DedicatedSystemMemory); + json.WriteString(L"SharedSystemMemory"); +- json.WriteNumber(m_AdapterDesc.SharedSystemMemory); ++ json.WriteNumber((UINT64)m_AdapterDesc.SharedSystemMemory); + + json.WriteString(L"ResourceHeapTier"); + json.WriteNumber(static_cast(m_D3D12Options.ResourceHeapTier)); + diff --git a/ports/d3d12-memory-allocator/CMakeLists.txt b/ports/d3d12-memory-allocator/CMakeLists.txt deleted file mode 100644 index b0202053d8..0000000000 --- a/ports/d3d12-memory-allocator/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(d3d12-memory-allocator) - -add_library(${PROJECT_NAME} STATIC - "src/D3D12MemAlloc.h" - "src/D3D12MemAlloc.cpp" -) - -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "src/D3D12MemAlloc.h") -target_include_directories(${PROJECT_NAME} INTERFACE PUBLIC $) - -install( - TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-config - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION include/ -) -install( - EXPORT ${PROJECT_NAME}-config DESTINATION cmake/ - NAMESPACE "unofficial::" -) \ No newline at end of file diff --git a/ports/d3d12-memory-allocator/portfile.cmake b/ports/d3d12-memory-allocator/portfile.cmake index 0ee730ce32..942e92fb46 100644 --- a/ports/d3d12-memory-allocator/portfile.cmake +++ b/ports/d3d12-memory-allocator/portfile.cmake @@ -1,15 +1,14 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator - REF 10f148cef0dfd34ae1a9373b9396beb1581c992a - SHA512 c99934a606ce5a5c9c59e05faf2e659bfad2e485b58aaf00f38219a6c89f17b62033f4a69935915f0d5269a4f0ecba41037b044913ae6f4077fa981eaab470c8 + REF v${VERSION} + SHA512 99d81cad82fe8c78cfbc7a2a611d31e3bb38df55ac938aec289d1085be2ec46129c74dd2f56c850f257c43c6bd122913910fb9512029a1b3ab4a02f2ed327931 HEAD_REF master + PATCHES + 0001-output-dirs.patch + 0002-Fix-32b-compilation.patch ) -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" ) diff --git a/ports/d3d12-memory-allocator/vcpkg.json b/ports/d3d12-memory-allocator/vcpkg.json index eadeb2167e..8cd975176d 100644 --- a/ports/d3d12-memory-allocator/vcpkg.json +++ b/ports/d3d12-memory-allocator/vcpkg.json @@ -1,9 +1,8 @@ { "name": "d3d12-memory-allocator", - "version-date": "2021-05-05", - "port-version": 1, + "version": "2.0.1", "description": "Easy to integrate D3d12 memory allocation library from GPUOpen", - "homepage": "https://gpuopen.com/gaming-product/d3d12-memory-allocator/", + "homepage": "https://gpuopen.com/d3d12-memory-allocator/", "license": "MIT", "supports": "windows", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 8a47c9c8a0..f01d61f596 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2121,8 +2121,8 @@ "port-version": 4 }, "d3d12-memory-allocator": { - "baseline": "2021-05-05", - "port-version": 1 + "baseline": "2.0.1", + "port-version": 0 }, "d3dx12": { "baseline": "may2021", diff --git a/versions/d-/d3d12-memory-allocator.json b/versions/d-/d3d12-memory-allocator.json index 38b67458f9..b80ffa1a24 100644 --- a/versions/d-/d3d12-memory-allocator.json +++ b/versions/d-/d3d12-memory-allocator.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b61a78756887ebcc5718bc7a32b8531fdc970d91", + "version": "2.0.1", + "port-version": 0 + }, { "git-tree": "7ada5dd1ad2d93ae0c4d56924dfaea88f8fc0e55", "version-date": "2021-05-05",