fixed custom allocator aligned memory allocations in tri sample.
authorunknown <deowens@MSDN-ORL-DOWENS.amd.com>
Thu, 21 Jan 2016 16:21:53 +0000 (11:21 -0500)
committerMark Young <marky@lunarg.com>
Tue, 26 Jan 2016 16:30:32 +0000 (09:30 -0700)
fixed x86 compilation.

demos/tri.c
demos/vulkaninfo.c

index 6b17eb3..e9285e5 100644 (file)
@@ -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;
index a8f3bd6..8b13ab4 100644 (file)
@@ -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,