summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_wsi.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-10-19 13:53:55 +1000
committerDave Airlie <[email protected]>2016-10-19 13:54:49 +1000
commit93ba86c307616af86bdfbae3576fc9493be418fd (patch)
tree0e9d4d3e05260654363a84987842f1718d187e38 /src/amd/vulkan/radv_wsi.c
parent63406b669e74d9ff38a45f362ceac816a7dad668 (diff)
radv: fix wsi porting regression in swapchain destroy.
The code in anv is right, there's a pending patch to fix this up different, but I'll sync the code for now.
Diffstat (limited to 'src/amd/vulkan/radv_wsi.c')
-rw-r--r--src/amd/vulkan/radv_wsi.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index ba5c37ba268..948be63c2c0 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -280,18 +280,25 @@ VkResult radv_CreateSwapchainKHR(
}
void radv_DestroySwapchainKHR(
- VkDevice device,
+ VkDevice _device,
VkSwapchainKHR _swapchain,
const VkAllocationCallbacks* pAllocator)
{
+ RADV_FROM_HANDLE(radv_device, device, _device);
RADV_FROM_HANDLE(wsi_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)
- radv_DestroyFence(device, swapchain->fences[i], pAllocator);
+ radv_DestroyFence(_device, swapchain->fences[i], pAllocator);
}
- swapchain->destroy(swapchain, pAllocator);
+ swapchain->destroy(swapchain, alloc);
}
VkResult radv_GetSwapchainImagesKHR(