From e7e75e4bffbf9f0acc1de1dfe601313db6bda3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 26 May 2023 08:40:53 -0700 Subject: [PATCH] Cleanup. --- src/renderer_vk.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index b3280e8a3..6d52e2085 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -527,10 +527,12 @@ VK_IMPORT_DEVICE }; BX_STATIC_ASSERT(VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE == BX_COUNTOF(s_allocScopeName)-1); + constexpr size_t kMinAlignment = 8; + static void* VKAPI_PTR allocationFunction(void* _userData, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) { BX_UNUSED(_userData); - return bx::alignedAlloc(g_allocator, _size, bx::max(_alignment, 8), bx::Location(s_allocScopeName[_allocationScope], 0) ); + return bx::alignedAlloc(g_allocator, _size, bx::max(kMinAlignment, _alignment), bx::Location(s_allocScopeName[_allocationScope], 0) ); } static void* VKAPI_PTR reallocationFunction(void* _userData, void* _original, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) @@ -540,7 +542,7 @@ VK_IMPORT_DEVICE bx::alignedFree(g_allocator, _original, 0); return NULL; } - return bx::alignedRealloc(g_allocator, _original, _size, bx::max(_alignment, 8), bx::Location(s_allocScopeName[_allocationScope], 0) ); + return bx::alignedRealloc(g_allocator, _original, _size, bx::max(kMinAlignment, _alignment), bx::Location(s_allocScopeName[_allocationScope], 0) ); } static void VKAPI_PTR freeFunction(void* _userData, void* _memory)