Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: gpu/vulkan/vulkan_platform.h

Issue 1925603002: Introduce Android WSI extension for Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/vulkan/vulkan_implementation.cc ('k') | gpu/vulkan/vulkan_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « gpu/vulkan/vulkan_implementation.cc ('k') | gpu/vulkan/vulkan_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698