Index: gpu/vulkan/vulkan_platform.h |
diff --git a/gpu/vulkan/vulkan_platform.h b/gpu/vulkan/vulkan_platform.h |
index 471b65ed1ffb0d82e09524c7603d83fd25905264..674b4a9b7778ee96221d926b2271d410cc4c4b4e 100644 |
--- a/gpu/vulkan/vulkan_platform.h |
+++ b/gpu/vulkan/vulkan_platform.h |
@@ -17,6 +17,10 @@ extern "C" { |
#define VK_USE_PLATFORM_XLIB_KHR |
#endif |
+#if defined(OS_ANDROID) |
+#define VK_USE_PLATFORM_ANDROID_KHR |
+#endif |
+ |
// This section below is taken from <vulkan/vulkan.h> |
#ifdef VK_USE_PLATFORM_XLIB_KHR |
#define VK_KHR_xlib_surface 1 |
@@ -61,6 +65,37 @@ vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
#endif |
#endif /* VK_USE_PLATFORM_XLIB_KHR */ |
+#ifdef VK_USE_PLATFORM_ANDROID_KHR |
+#define VK_KHR_android_surface 1 |
+#include <android/native_window.h> |
+ |
+#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 |
+#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" |
+ |
+typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; |
+ |
+typedef struct VkAndroidSurfaceCreateInfoKHR { |
+ VkStructureType sType; |
+ const void* pNext; |
+ VkAndroidSurfaceCreateFlagsKHR flags; |
+ ANativeWindow* window; |
+} VkAndroidSurfaceCreateInfoKHR; |
+ |
+typedef VkResult(VKAPI_PTR* PFN_vkCreateAndroidSurfaceKHR)( |
+ VkInstance instance, |
+ const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
+ const VkAllocationCallbacks* pAllocator, |
+ VkSurfaceKHR* pSurface); |
+ |
+#ifndef VK_NO_PROTOTYPES |
+VKAPI_ATTR VkResult VKAPI_CALL |
+vkCreateAndroidSurfaceKHR(VkInstance instance, |
+ const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
+ const VkAllocationCallbacks* pAllocator, |
+ VkSurfaceKHR* pSurface); |
+#endif |
+#endif /* VK_USE_PLATFORM_ANDROID_KHR */ |
+ |
#ifdef __cplusplus |
} // extern "C" |
#endif |