summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-10-14 02:38:49 +0100
committerDave Airlie <airlied@redhat.com>2016-10-19 10:15:43 +1000
commit954cd09e6682557d483c36b234f9d923ad754305 (patch)
tree91d9fb4cdbd8172fb6e7218fb5bc238daf64cd50 /src/intel/vulkan/anv_wsi.c
parent1720bbd353d87412754fd4ecb6fa76406d54d413 (diff)
downloadexternal_mesa3d-954cd09e6682557d483c36b234f9d923ad754305.zip
external_mesa3d-954cd09e6682557d483c36b234f9d923ad754305.tar.gz
external_mesa3d-954cd09e6682557d483c36b234f9d923ad754305.tar.bz2
anv/wsi: move further away from passing anv displays around
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/intel/vulkan/anv_wsi.c')
-rw-r--r--src/intel/vulkan/anv_wsi.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 514a29f..89bf780 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -253,17 +253,21 @@ VkResult anv_CreateSwapchainKHR(
struct anv_wsi_interface *iface =
device->instance->physicalDevice.wsi_device.wsi[surface->platform];
struct anv_swapchain *swapchain;
+ const VkAllocationCallbacks *alloc;
- VkResult result = iface->create_swapchain(surface, device, pCreateInfo,
- pAllocator, &anv_wsi_image_fns,
+ if (pAllocator)
+ alloc = pAllocator;
+ else
+ alloc = &device->alloc;
+ VkResult result = iface->create_swapchain(surface, _device,
+ &device->instance->physicalDevice.wsi_device,
+ pCreateInfo,
+ alloc, &anv_wsi_image_fns,
&swapchain);
if (result != VK_SUCCESS)
return result;
- if (pAllocator)
- swapchain->alloc = *pAllocator;
- else
- swapchain->alloc = device->alloc;
+ swapchain->alloc = *alloc;
for (unsigned i = 0; i < ARRAY_SIZE(swapchain->fences); i++)
swapchain->fences[i] = VK_NULL_HANDLE;
@@ -274,18 +278,24 @@ VkResult anv_CreateSwapchainKHR(
}
void anv_DestroySwapchainKHR(
- VkDevice device,
+ VkDevice _device,
VkSwapchainKHR _swapchain,
const VkAllocationCallbacks* pAllocator)
{
+ ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_swapchain, swapchain, _swapchain);
+ const VkAllocationCallbacks *alloc;
+ if (pAllocator)
+ alloc = pAllocator;
+ else
+ alloc = &device->alloc;
for (unsigned i = 0; i < ARRAY_SIZE(swapchain->fences); i++) {
if (swapchain->fences[i] != VK_NULL_HANDLE)
- anv_DestroyFence(device, swapchain->fences[i], pAllocator);
+ anv_DestroyFence(_device, swapchain->fences[i], pAllocator);
}
- swapchain->destroy(swapchain, pAllocator);
+ swapchain->destroy(swapchain, alloc);
}
VkResult anv_GetSwapchainImagesKHR(