From 56d310dd46afaad28265423671101a56c0391bca Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 15 May 2018 11:36:30 +0900 Subject: [PATCH] swapchain: Changed the type of allocator to its pointer. Change-Id: I9ddcd491b48ce7d896df54b09e0b1a9a34204660 Signed-off-by: joonbum.ko --- src/wsi/swapchain.c | 12 ++++++------ src/wsi/swapchain_tpl.c | 4 ++-- src/wsi/wsi.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wsi/swapchain.c b/src/wsi/swapchain.c index a0273cd..fb68bb7 100644 --- a/src/wsi/swapchain.c +++ b/src/wsi/swapchain.c @@ -123,7 +123,7 @@ vk_CreateSwapchainKHR(VkDevice device, memset(chain, 0x00, sizeof(vk_swapchain_t)); - chain->allocator = *allocator; + chain->allocator = allocator; chain->surface = info->surface; format = get_tbm_format(info->imageFormat, info->compositeAlpha); @@ -135,7 +135,7 @@ vk_CreateSwapchainKHR(VkDevice device, error = chain->get_buffers(device, chain, &buffers, &chain->buffer_count); VK_CHECK(error == VK_SUCCESS, goto done, "swapchain backend get buffers failed.\n"); - chain->buffers = vk_alloc(&chain->allocator, chain->buffer_count * sizeof(vk_buffer_t), + chain->buffers = vk_alloc(chain->allocator, chain->buffer_count * sizeof(vk_buffer_t), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); VK_CHECK(chain->buffers, goto error_mem_alloc, "vk_alloc() failed.\n"); @@ -160,7 +160,7 @@ vk_CreateSwapchainKHR(VkDevice device, chain->buffers[i].tbm = buffers[i]; icd->create_presentable_image(device, chain->buffers[i].tbm, &image_info, - &chain->allocator, &chain->buffers[i].image); + chain->allocator, &chain->buffers[i].image); } goto done; @@ -210,13 +210,13 @@ vk_DestroySwapchainKHR(VkDevice device, uint32_t i; for (i = 0; i < chain->buffer_count; i++) - destroy_image(device, chain->buffers[i].image, &chain->allocator); + destroy_image(device, chain->buffers[i].image, chain->allocator); } } chain->deinit(device, chain); - vk_free(&chain->allocator, chain->buffers); - vk_free(&chain->allocator, chain); + vk_free(chain->allocator, chain->buffers); + vk_free(chain->allocator, chain); } } diff --git a/src/wsi/swapchain_tpl.c b/src/wsi/swapchain_tpl.c index cc1fee9..2985f30 100644 --- a/src/wsi/swapchain_tpl.c +++ b/src/wsi/swapchain_tpl.c @@ -98,7 +98,7 @@ swapchain_tpl_deinit(VkDevice device, if (swapchain_tpl->buffers) free(swapchain_tpl->buffers); - vk_free(&chain->allocator, swapchain_tpl); + vk_free(chain->allocator, swapchain_tpl); } } @@ -144,7 +144,7 @@ swapchain_tpl_init(VkDevice device, VkResult error = VK_ERROR_DEVICE_LOST; - swapchain_tpl = vk_alloc(&chain->allocator, sizeof(vk_swapchain_tpl_t), + swapchain_tpl = vk_alloc(chain->allocator, sizeof(vk_swapchain_tpl_t), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); VK_CHECK(swapchain_tpl, return VK_ERROR_OUT_OF_HOST_MEMORY, "vk_alloc() failed.\n"); memset(swapchain_tpl, 0x00, sizeof(*swapchain_tpl)); diff --git a/src/wsi/wsi.h b/src/wsi/wsi.h index d371067..e45dfc8 100644 --- a/src/wsi/wsi.h +++ b/src/wsi/wsi.h @@ -123,7 +123,7 @@ struct vk_buffer { }; struct vk_swapchain { - VkAllocationCallbacks allocator; + VkAllocationCallbacks *allocator; VkSurfaceKHR surface; VkResult (*get_buffers) (VkDevice, -- 2.7.4