From 6363606ca2a406c7fe580006c1d2e2e049535e91 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 26 Oct 2015 21:10:41 +0800 Subject: bug 12921: Memory callback (WIP) The per-object allocator is ignored for now. https://cvs.khronos.org/bugzilla/show_bug.cgi?id=12921 --- layers/basic.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'layers/basic.cpp') diff --git a/layers/basic.cpp b/layers/basic.cpp index 778a3629..f416d5a5 100644 --- a/layers/basic.cpp +++ b/layers/basic.cpp @@ -95,27 +95,27 @@ VK_LAYER_EXPORT VkResult VKAPI basic_EnumeratePhysicalDevices( return result; } -VK_LAYER_EXPORT VkResult VKAPI basic_CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) +VK_LAYER_EXPORT VkResult VKAPI basic_CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, const VkAllocCallbacks* pAllocator, VkDevice* pDevice) { printf("At start of wrapped vkCreateDevice() call w/ gpu: %p\n", (void*)gpu); - VkResult result = device_dispatch_table(*pDevice)->CreateDevice(gpu, pCreateInfo, pDevice); + VkResult result = device_dispatch_table(*pDevice)->CreateDevice(gpu, pCreateInfo, pAllocator, pDevice); printf("Completed wrapped vkCreateDevice() call w/ pDevice, Device %p: %p\n", (void*)pDevice, (void *) *pDevice); return result; } /* hook DestroyDevice to remove tableMap entry */ -VK_LAYER_EXPORT void VKAPI basic_DestroyDevice(VkDevice device) +VK_LAYER_EXPORT void VKAPI basic_DestroyDevice(VkDevice device, const VkAllocCallbacks* pAllocator) { dispatch_key key = get_dispatch_key(device); - device_dispatch_table(device)->DestroyDevice(device); + device_dispatch_table(device)->DestroyDevice(device, pAllocator); destroy_device_dispatch_table(key); } /* hook DestroyInstance to remove tableInstanceMap entry */ -VK_LAYER_EXPORT void VKAPI basic_DestroyInstance(VkInstance instance) +VK_LAYER_EXPORT void VKAPI basic_DestroyInstance(VkInstance instance, const VkAllocCallbacks* pAllocator) { dispatch_key key = get_dispatch_key(instance); - instance_dispatch_table(instance)->DestroyInstance(instance); + instance_dispatch_table(instance)->DestroyInstance(instance, pAllocator); destroy_instance_dispatch_table(key); } -- cgit v1.2.3