loader: Fixes for ICD vk{Create|Destroy}SurfaceKHR
Need to keep VkIcdSurface private to the loader.
The definition may conflict with some redefinitions of
VK_DEFINE_NON_DISPATCHABLE_HANDLE and it's not necessary to make public
anyway.
Change-Id: I30e166f0ecce2fd3ea36c745dc073b705973d75f
diff --git a/loader/wsi.c b/loader/wsi.c
index d38085d..123a7f8 100644
--- a/loader/wsi.c
+++ b/loader/wsi.c
@@ -221,7 +221,7 @@
struct loader_icd *icd = &ptr_instance->icds[i];
if (NULL != icd->DestroySurfaceKHR &&
NULL != (void *)icd_surface->real_icd_surfaces[i]) {
- icd->DestroySurfaceKHR(instance,
+ icd->DestroySurfaceKHR(icd->instance,
icd_surface->real_icd_surfaces[i],
pAllocator);
icd_surface->real_icd_surfaces[i] = (VkSurfaceKHR)NULL;
@@ -490,7 +490,6 @@
uint32_t icd_index = 0;
struct loader_device *dev;
struct loader_icd *icd = loader_get_icd_and_device(device, &dev, &icd_index);
- PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
if (NULL != icd &&
NULL != icd->CreateSwapchainKHR) {
// Android doesn't have to worry about multiple ICD scenario, but the rest do.
@@ -506,7 +505,7 @@
if (NULL == pCreateCopy) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
- memcpy(pCreateCopy, pCreateInfo, sizeof(VkIcdSurface));
+ memcpy(pCreateCopy, pCreateInfo, sizeof(VkSwapchainCreateInfoKHR));
pCreateCopy->surface =
icd_surface->real_icd_surfaces[icd_index];
return icd->CreateSwapchainKHR(device, pCreateCopy, pAllocator, pSwapchain);
@@ -631,7 +630,7 @@
struct loader_icd *icd = &ptr_instance->icds[i];
if (NULL != icd->CreateWin32SurfaceKHR) {
vkRes = icd->CreateWin32SurfaceKHR(
- instance, pCreateInfo, pAllocator,
+ icd->instance, pCreateInfo, pAllocator,
&pIcdSurface->real_icd_surfaces[i]);
if (VK_SUCCESS != vkRes) {
goto out;
@@ -651,7 +650,7 @@
if (NULL != pIcdSurface->real_icd_surfaces[i] &&
NULL != icd->DestroySurfaceKHR) {
icd->DestroySurfaceKHR(
- instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
+ icd->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
@@ -775,7 +774,7 @@
struct loader_icd *icd = &ptr_instance->icds[i];
if (NULL != icd->CreateMirSurfaceKHR) {
vkRes = icd->CreateMirSurfaceKHR(
- instance, pCreateInfo, pAllocator,
+ icd->instance, pCreateInfo, pAllocator,
&pIcdSurface->real_icd_surfaces[i]);
if (VK_SUCCESS != vkRes) {
goto out;
@@ -795,7 +794,7 @@
if (NULL != pIcdSurface->real_icd_surfaces[i] &&
NULL != icd->DestroySurfaceKHR) {
icd->DestroySurfaceKHR(
- instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
+ icd->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
@@ -922,7 +921,7 @@
struct loader_icd *icd = &ptr_instance->icds[i];
if (NULL != icd->CreateWaylandSurfaceKHR) {
vkRes = icd->CreateWaylandSurfaceKHR(
- instance, pCreateInfo, pAllocator,
+ icd->instance, pCreateInfo, pAllocator,
&pIcdSurface->real_icd_surfaces[i]);
if (VK_SUCCESS != vkRes) {
goto out;
@@ -942,7 +941,7 @@
if (NULL != pIcdSurface->real_icd_surfaces[i] &&
NULL != icd->DestroySurfaceKHR) {
icd->DestroySurfaceKHR(
- instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
+ icd->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
@@ -1070,7 +1069,7 @@
struct loader_icd *icd = &ptr_instance->icds[i];
if (NULL != icd->CreateXcbSurfaceKHR) {
vkRes = icd->CreateXcbSurfaceKHR(
- instance, pCreateInfo, pAllocator,
+ icd->instance, pCreateInfo, pAllocator,
&pIcdSurface->real_icd_surfaces[i]);
if (VK_SUCCESS != vkRes) {
goto out;
@@ -1090,7 +1089,7 @@
if (NULL != pIcdSurface->real_icd_surfaces[i] &&
NULL != icd->DestroySurfaceKHR) {
icd->DestroySurfaceKHR(
- instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
+ icd->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
@@ -1217,7 +1216,7 @@
struct loader_icd *icd = &ptr_instance->icds[i];
if (NULL != icd->CreateXlibSurfaceKHR) {
vkRes = icd->CreateXlibSurfaceKHR(
- instance, pCreateInfo, pAllocator,
+ icd->instance, pCreateInfo, pAllocator,
&pIcdSurface->real_icd_surfaces[i]);
if (VK_SUCCESS != vkRes) {
goto out;
@@ -1237,7 +1236,7 @@
if (NULL != pIcdSurface->real_icd_surfaces[i] &&
NULL != icd->DestroySurfaceKHR) {
icd->DestroySurfaceKHR(
- instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
+ icd->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);