aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-12-08 16:36:22 -0700
committerJon Ashburn <jon@lunarg.com>2015-12-09 08:50:03 -0700
commit4cd9a236c7e769167caee71c9e97d242e1dc48d9 (patch)
treeaa90d223426afef350d360cd0e64901d7d1096bd
parenta21d6ab01286d7bbc540811f39ce8d232680771f (diff)
downloadusermoji-4cd9a236c7e769167caee71c9e97d242e1dc48d9.tar.xz
demos: Fix bug in tri so it uses a realloc callback since it uses alloc callback
-rw-r--r--demos/tri.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/demos/tri.c b/demos/tri.c
index a1c2588c..4f404dc7 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -1692,6 +1692,15 @@ static VkBool32 demo_check_layers(uint32_t check_count, char **check_names,
}
return 1;
}
+VKAPI_ATTR void* VKAPI_CALL myrealloc(
+ void* pUserData,
+ void* pOriginal,
+ size_t size,
+ size_t alignment,
+ VkSystemAllocationScope allocationScope)
+{
+ return realloc(pOriginal, size);
+}
VKAPI_ATTR void* VKAPI_CALL myalloc(
void* pUserData,
@@ -1838,6 +1847,7 @@ static void demo_init_vk(struct demo *demo)
demo->allocator.pfnAllocation = myalloc;
demo->allocator.pfnFree = myfree;
+ demo->allocator.pfnReallocation = myrealloc;
err = vkCreateInstance(&inst_info, &demo->allocator, &demo->inst);
if (err == VK_ERROR_INCOMPATIBLE_DRIVER) {