[d3d12-memory-allocator] Update to 3.0.1. (#45507)

This commit is contained in:
Carsten Rudolph 2025-05-14 23:58:58 +02:00 committed by GitHub
parent 8abca2e153
commit bffb944e5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 48 additions and 57 deletions

View File

@ -0,0 +1,35 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 34fcecd..d796333 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -26,14 +26,16 @@ set_target_properties(
MINSIZEREL_POSTFIX "s"
)
+find_package(directx-headers CONFIG REQUIRED)
+
+target_compile_definitions(D3D12MemoryAllocator PUBLIC D3D12MA_USING_DIRECTX_HEADERS)
+
target_include_directories(D3D12MemoryAllocator PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:./include>
)
target_link_libraries(D3D12MemoryAllocator PUBLIC
- d3d12.lib
- dxgi.lib
- dxguid.lib
+ Microsoft::DirectX-Headers Microsoft::DirectX-Guids d3d12.lib dxgi.lib
)
if(BUILD_SHARED_LIBS)
diff --git a/src/cmake/config.cmake.in b/src/cmake/config.cmake.in
index 3e47daa..08de2e8 100644
--- a/src/cmake/config.cmake.in
+++ b/src/cmake/config.cmake.in
@@ -1,3 +1,4 @@
include(CMakeFindDependencyMacro)
+find_dependency(directx-headers CONFIG)
-include("${CMAKE_CURRENT_LIST_DIR}/@D3D12MA_TARGETS_EXPORT_NAME@.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/@D3D12MA_TARGETS_EXPORT_NAME@.cmake")
\ No newline at end of file

View File

@ -1,30 +0,0 @@
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 $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+set_target_properties(D3D12MemoryAllocator PROPERTIES PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/include/D3D12MemAlloc.h")
+
+install(
+ EXPORT d3d12-memory-allocator-config DESTINATION cmake/
+ NAMESPACE "unofficial::"
+)

View File

@ -1,20 +0,0 @@
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<UINT>(m_D3D12Options.ResourceHeapTier));

View File

@ -2,11 +2,9 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator
REF v${VERSION}
SHA512 99d81cad82fe8c78cfbc7a2a611d31e3bb38df55ac938aec289d1085be2ec46129c74dd2f56c850f257c43c6bd122913910fb9512029a1b3ab4a02f2ed327931
SHA512 58d44aa021a04c1fa82cf5ff76420de43091d5475da9c23975176058990e0e3e1106aa13042ea6e75d29dd71f821b5431f9f12b62fba5e58955aa30127b4221b
HEAD_REF master
PATCHES
0001-output-dirs.patch
0002-Fix-32b-compilation.patch
PATCHES "0001-build-options.patch"
)
vcpkg_cmake_configure(
@ -15,7 +13,10 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake/)
vcpkg_cmake_config_fixup(
PACKAGE_NAME D3D12MemoryAllocator
CONFIG_PATH share/cmake/D3D12MemoryAllocator/
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

View File

@ -1,6 +1,6 @@
{
"name": "d3d12-memory-allocator",
"version": "2.0.1",
"version": "3.0.1",
"description": "Easy to integrate D3d12 memory allocation library from GPUOpen",
"homepage": "https://gpuopen.com/d3d12-memory-allocator/",
"license": "MIT",

View File

@ -2229,7 +2229,7 @@
"port-version": 4
},
"d3d12-memory-allocator": {
"baseline": "2.0.1",
"baseline": "3.0.1",
"port-version": 0
},
"d3dx12": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1eb283d295a0a125ab901f2811ef1fd5520446e0",
"version": "3.0.1",
"port-version": 0
},
{
"git-tree": "b61a78756887ebcc5718bc7a32b8531fdc970d91",
"version": "2.0.1",