loader: Fix Android build
authorKévin Petit <kevin.petit@arm.com>
Thu, 28 Jan 2021 20:15:51 +0000 (20:15 +0000)
committerLenny Komow <lenny@lunarg.com>
Fri, 29 Jan 2021 00:19:33 +0000 (17:19 -0700)
- Add missing prototype
- Fix incorrect parameter handling

Signed-off-by: Kévin Petit <kevin.petit@arm.com>
loader/wsi.c
loader/wsi.h

index 523f16a28021f53a9f9d41f5c9b2a0dc5d0f0df4..756225a4e7388fc54ae921970399dfdb84cbd612 100644 (file)
@@ -1095,19 +1095,19 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceDirectFBPresentationS
 // Functions for the VK_KHR_android_surface extension:
 
 // This is the trampoline entrypoint for CreateAndroidSurfaceKHR
-LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(VkInstance instance, ANativeWindow *window,
+LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
                                                                        const VkAllocationCallbacks *pAllocator,
                                                                        VkSurfaceKHR *pSurface) {
     const VkLayerInstanceDispatchTable *disp;
     disp = loader_get_instance_layer_dispatch(instance);
     VkResult res;
 
-    res = disp->CreateAndroidSurfaceKHR(instance, window, pAllocator, pSurface);
+    res = disp->CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
     return res;
 }
 
 // This is the instance chain terminator function for CreateAndroidSurfaceKHR
-VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR(VkInstance instance, Window window,
+VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
                                                                   const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
     // First, check to ensure the appropriate extension was enabled:
     struct loader_instance *ptr_instance = loader_get_instance(instance);
@@ -1125,7 +1125,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR(VkInstance ins
     }
 
     pIcdSurface->base.platform = VK_ICD_WSI_PLATFORM_ANDROID;
-    pIcdSurface->window = window;
+    pIcdSurface->window = pCreateInfo->window;
 
     *pSurface = (VkSurfaceKHR)pIcdSurface;
 
index c9f46549146946b8b08de83577f8d672ecdb12b6..cad0d45b4925f8da6abe5cd49940b54500095328 100644 (file)
@@ -207,6 +207,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateImagePipeSurfaceFUCHSIA(VkInstan
                                                                 const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
 #endif
 
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
+                                                                  const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
+#endif
+
 VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR(
     VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
     VkSurfaceCapabilities2KHR *pSurfaceCapabilities);