From 64377e4424a38deb20ce7855938ebc5d799a8fe5 Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 4 Sep 2026 23:04:25 +0000 Subject: [PATCH] 2026-09-04 23:04:25 Signed-off-by: lizzie --- .../0001-macos-clang.patch | 112 ++++++++++++++++++ cpmfile.json | 3 + src/yuzu/main_window.cpp | 2 +- 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 .patch/vulkan-memory-allocator/0001-macos-clang.patch diff --git a/.patch/vulkan-memory-allocator/0001-macos-clang.patch b/.patch/vulkan-memory-allocator/0001-macos-clang.patch new file mode 100644 index 0000000000..e965292f6f --- /dev/null +++ b/.patch/vulkan-memory-allocator/0001-macos-clang.patch @@ -0,0 +1,112 @@ +diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h +index 8df0364..4856064 100644 +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -3017,7 +3017,7 @@ remove them if not needed. + + #if defined(__ANDROID_API__) && (__ANDROID_API__ < 16) + #include +-static void* vma_aligned_alloc(size_t alignment, size_t size) ++static inline void* vma_aligned_alloc(size_t alignment, size_t size) + { + // alignment must be >= sizeof(void*) + if(alignment < sizeof(void*)) +@@ -3860,7 +3860,7 @@ Returned value is the found element, if present in the collection or place where + new element with value (key) should be inserted. + */ + template +-static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp) ++static inline IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp) + { + size_t down = 0; + size_t up = size_t(end - beg); +@@ -3898,7 +3898,7 @@ Warning! O(n^2) complexity. Use only inside VMA_HEAVY_ASSERT. + T must be pointer type, e.g. VmaAllocation, VmaPool. + */ + template +-static bool VmaValidatePointerArray(uint32_t count, const T* arr) ++static inline bool VmaValidatePointerArray(uint32_t count, const T* arr) + { + for (uint32_t i = 0; i < count; ++i) + { +@@ -4188,13 +4188,13 @@ static void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr + } + + template +-static T* VmaAllocate(const VkAllocationCallbacks* pAllocationCallbacks) ++static inline T* VmaAllocate(const VkAllocationCallbacks* pAllocationCallbacks) + { + return (T*)VmaMalloc(pAllocationCallbacks, sizeof(T), VMA_ALIGN_OF(T)); + } + + template +-static T* VmaAllocateArray(const VkAllocationCallbacks* pAllocationCallbacks, size_t count) ++static inline T* VmaAllocateArray(const VkAllocationCallbacks* pAllocationCallbacks, size_t count) + { + return (T*)VmaMalloc(pAllocationCallbacks, sizeof(T) * count, VMA_ALIGN_OF(T)); + } +@@ -4204,14 +4204,14 @@ static T* VmaAllocateArray(const VkAllocationCallbacks* pAllocationCallbacks, si + #define vma_new_array(allocator, type, count) new(VmaAllocateArray((allocator), (count)))(type) + + template +-static void vma_delete(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr) ++static inline void vma_delete(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr) + { + ptr->~T(); + VmaFree(pAllocationCallbacks, ptr); + } + + template +-static void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr, size_t count) ++static inline void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr, size_t count) + { + if (ptr != VMA_NULL) + { +@@ -4658,13 +4658,13 @@ void VmaVector::remove(size_t index) + #endif // _VMA_VECTOR_FUNCTIONS + + template +-static void VmaVectorInsert(VmaVector& vec, size_t index, const T& item) ++static inline void VmaVectorInsert(VmaVector& vec, size_t index, const T& item) + { + vec.insert(index, item); + } + + template +-static void VmaVectorRemove(VmaVector& vec, size_t index) ++static inline void VmaVectorRemove(VmaVector& vec, size_t index) + { + vec.remove(index); + } +@@ -10620,19 +10620,19 @@ static void VmaFree(VmaAllocator hAllocator, void* ptr) + } + + template +-static T* VmaAllocate(VmaAllocator hAllocator) ++static inline T* VmaAllocate(VmaAllocator hAllocator) + { + return (T*)VmaMalloc(hAllocator, sizeof(T), VMA_ALIGN_OF(T)); + } + + template +-static T* VmaAllocateArray(VmaAllocator hAllocator, size_t count) ++static inline T* VmaAllocateArray(VmaAllocator hAllocator, size_t count) + { + return (T*)VmaMalloc(hAllocator, sizeof(T) * count, VMA_ALIGN_OF(T)); + } + + template +-static void vma_delete(VmaAllocator hAllocator, T* ptr) ++static inline void vma_delete(VmaAllocator hAllocator, T* ptr) + { + if(ptr != VMA_NULL) + { +@@ -10642,7 +10642,7 @@ static void vma_delete(VmaAllocator hAllocator, T* ptr) + } + + template +-static void vma_delete_array(VmaAllocator hAllocator, T* ptr, size_t count) ++static inline void vma_delete_array(VmaAllocator hAllocator, T* ptr, size_t count) + { + if(ptr != VMA_NULL) + { diff --git a/cpmfile.json b/cpmfile.json index c5ea35c955..412c8bd5e1 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -311,6 +311,9 @@ "find_args": "CONFIG", "hash": "deb5902ef8db0e329fbd5f3f4385eb0e26bdd9f14f3a2334823fb3fe18f36bc5d235d620d6e5f6fe3551ec3ea7038638899db8778c09f6d5c278f5ff95c3344b", "package": "VulkanMemoryAllocator", + "patches": [ + "0001-macos-clang.patch" + ], "repo": "GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator", "version": "v3.3.0" }, diff --git a/src/yuzu/main_window.cpp b/src/yuzu/main_window.cpp index 27b018d9d9..3f7feb83b2 100644 --- a/src/yuzu/main_window.cpp +++ b/src/yuzu/main_window.cpp @@ -4796,6 +4796,6 @@ void VolumeButton::ResetMultiplier() { #endif #if !defined(QT_STATICPLUGIN) || defined(__APPLE__) -#define VMA_IMPLEMENTATION +#define VMA_IMPLEMENTATION 1 #include "video_core/vulkan_common/vma.h" #endif