swapchain: Changed the type of allocator to its pointer. 45/178945/1
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 15 May 2018 02:36:30 +0000 (11:36 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Tue, 15 May 2018 02:36:30 +0000 (11:36 +0900)
Change-Id: I9ddcd491b48ce7d896df54b09e0b1a9a34204660
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/wsi/swapchain.c
src/wsi/swapchain_tpl.c
src/wsi/wsi.h

index a0273cd..fb68bb7 100644 (file)
@@ -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);
        }
 }
 
index cc1fee9..2985f30 100644 (file)
@@ -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));
index d371067..e45dfc8 100644 (file)
@@ -123,7 +123,7 @@ struct vk_buffer {
 };
 
 struct vk_swapchain {
-       VkAllocationCallbacks    allocator;
+       VkAllocationCallbacks    *allocator;
        VkSurfaceKHR                     surface;
 
        VkResult                                (*get_buffers)  (VkDevice,