OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is used so we only include platform specific headers when | 5 // This file is used so we only include platform specific headers when |
6 // necessary. Otherwise some headers such as for X11 define extra macros which | 6 // necessary. Otherwise some headers such as for X11 define extra macros which |
7 // can conflict with other headers. | 7 // can conflict with other headers. |
8 | 8 |
9 #ifndef GPU_VULKAN_VULKAN_H_ | 9 #ifndef GPU_VULKAN_VULKAN_H_ |
10 #define GPU_VULKAN_VULKAN_H_ | 10 #define GPU_VULKAN_VULKAN_H_ |
11 | 11 |
12 #ifdef __cplusplus | 12 #ifdef __cplusplus |
13 extern "C" { | 13 extern "C" { |
14 #endif | 14 #endif |
15 | 15 |
16 #if defined(USE_X11) | 16 #if defined(USE_X11) |
17 #define VK_USE_PLATFORM_XLIB_KHR | 17 #define VK_USE_PLATFORM_XLIB_KHR |
18 #endif | 18 #endif |
19 | 19 |
| 20 #if defined(OS_ANDROID) |
| 21 #define VK_USE_PLATFORM_ANDROID_KHR |
| 22 #endif |
| 23 |
20 // This section below is taken from <vulkan/vulkan.h> | 24 // This section below is taken from <vulkan/vulkan.h> |
21 #ifdef VK_USE_PLATFORM_XLIB_KHR | 25 #ifdef VK_USE_PLATFORM_XLIB_KHR |
22 #define VK_KHR_xlib_surface 1 | 26 #define VK_KHR_xlib_surface 1 |
23 #include <X11/Xlib.h> | 27 #include <X11/Xlib.h> |
24 | 28 |
25 #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 | 29 #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 |
26 #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" | 30 #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" |
27 | 31 |
28 typedef VkFlags VkXlibSurfaceCreateFlagsKHR; | 32 typedef VkFlags VkXlibSurfaceCreateFlagsKHR; |
29 | 33 |
(...skipping 24 matching lines...) Expand all Loading... |
54 VkSurfaceKHR* pSurface); | 58 VkSurfaceKHR* pSurface); |
55 | 59 |
56 VKAPI_ATTR VkBool32 VKAPI_CALL | 60 VKAPI_ATTR VkBool32 VKAPI_CALL |
57 vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, | 61 vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
58 uint32_t queueFamilyIndex, | 62 uint32_t queueFamilyIndex, |
59 Display* dpy, | 63 Display* dpy, |
60 VisualID visualID); | 64 VisualID visualID); |
61 #endif | 65 #endif |
62 #endif /* VK_USE_PLATFORM_XLIB_KHR */ | 66 #endif /* VK_USE_PLATFORM_XLIB_KHR */ |
63 | 67 |
| 68 #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 69 #define VK_KHR_android_surface 1 |
| 70 #include <android/native_window.h> |
| 71 |
| 72 #define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 |
| 73 #define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" |
| 74 |
| 75 typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; |
| 76 |
| 77 typedef struct VkAndroidSurfaceCreateInfoKHR { |
| 78 VkStructureType sType; |
| 79 const void* pNext; |
| 80 VkAndroidSurfaceCreateFlagsKHR flags; |
| 81 ANativeWindow* window; |
| 82 } VkAndroidSurfaceCreateInfoKHR; |
| 83 |
| 84 typedef VkResult(VKAPI_PTR* PFN_vkCreateAndroidSurfaceKHR)( |
| 85 VkInstance instance, |
| 86 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 87 const VkAllocationCallbacks* pAllocator, |
| 88 VkSurfaceKHR* pSurface); |
| 89 |
| 90 #ifndef VK_NO_PROTOTYPES |
| 91 VKAPI_ATTR VkResult VKAPI_CALL |
| 92 vkCreateAndroidSurfaceKHR(VkInstance instance, |
| 93 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 94 const VkAllocationCallbacks* pAllocator, |
| 95 VkSurfaceKHR* pSurface); |
| 96 #endif |
| 97 #endif /* VK_USE_PLATFORM_ANDROID_KHR */ |
| 98 |
64 #ifdef __cplusplus | 99 #ifdef __cplusplus |
65 } // extern "C" | 100 } // extern "C" |
66 #endif | 101 #endif |
67 | 102 |
68 #endif // GPU_VULKAN_VULKAN_H_ | 103 #endif // GPU_VULKAN_VULKAN_H_ |
OLD | NEW |