From 4ee44fc18c0582edb7b193a9c08ab9a3222f9033 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Jan 2016 11:21:53 -0500 Subject: fixed custom allocator aligned memory allocations in tri sample. fixed x86 compilation. --- demos/tri.c | 11 ++++++++++- demos/vulkaninfo.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/demos/tri.c b/demos/tri.c index 6b17eb34..e9285e5c 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1730,14 +1730,23 @@ VKAPI_ATTR void* VKAPI_CALL myalloc( size_t alignment, VkSystemAllocationScope allocationScope) { - return malloc(size); +#ifdef _MSC_VER + return _aligned_malloc(size, alignment); +#else + return aligned_malloc(alignment, size); +#endif } VKAPI_ATTR void VKAPI_CALL myfree( void* pUserData, void* pMemory) { +#ifdef _MSC_VER + _aligned_free(pMemory); +#else free(pMemory); +#endif } + static void demo_init_vk(struct demo *demo) { VkResult err; diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c index a8f3bd64..8b13ab4d 100644 --- a/demos/vulkaninfo.c +++ b/demos/vulkaninfo.c @@ -130,7 +130,7 @@ struct app_gpu { }; static VKAPI_ATTR VkBool32 VKAPI_CALL dbg_callback( - VkDebugReportFlagsEXT msgFlags, + VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, size_t location, -- cgit v1.2.3