1#ifndef VULKAN_ANDROID_H_
2#define VULKAN_ANDROID_H_ 1
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/*
9** Copyright (c) 2015-2019 The Khronos Group Inc.
10**
11** Licensed under the Apache License, Version 2.0 (the "License");
12** you may not use this file except in compliance with the License.
13** You may obtain a copy of the License at
14**
15**     http://www.apache.org/licenses/LICENSE-2.0
16**
17** Unless required by applicable law or agreed to in writing, software
18** distributed under the License is distributed on an "AS IS" BASIS,
19** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20** See the License for the specific language governing permissions and
21** limitations under the License.
22*/
23
24/*
25** This header is generated from the Khronos Vulkan XML API Registry.
26**
27*/
28
29
30
31#define VK_KHR_android_surface 1
32struct ANativeWindow;
33#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
34#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
35typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
36typedef struct VkAndroidSurfaceCreateInfoKHR {
37    VkStructureType                   sType;
38    const void*                       pNext;
39    VkAndroidSurfaceCreateFlagsKHR    flags;
40    struct ANativeWindow*             window;
41} VkAndroidSurfaceCreateInfoKHR;
42
43typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
44
45#ifndef VK_NO_PROTOTYPES
46VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
47    VkInstance                                  instance,
48    const VkAndroidSurfaceCreateInfoKHR*        pCreateInfo,
49    const VkAllocationCallbacks*                pAllocator,
50    VkSurfaceKHR*                               pSurface);
51#endif
52
53
54#define VK_ANDROID_external_memory_android_hardware_buffer 1
55struct AHardwareBuffer;
56#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
57#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
58typedef struct VkAndroidHardwareBufferUsageANDROID {
59    VkStructureType    sType;
60    void*              pNext;
61    uint64_t           androidHardwareBufferUsage;
62} VkAndroidHardwareBufferUsageANDROID;
63
64typedef struct VkAndroidHardwareBufferPropertiesANDROID {
65    VkStructureType    sType;
66    void*              pNext;
67    VkDeviceSize       allocationSize;
68    uint32_t           memoryTypeBits;
69} VkAndroidHardwareBufferPropertiesANDROID;
70
71typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
72    VkStructureType                  sType;
73    void*                            pNext;
74    VkFormat                         format;
75    uint64_t                         externalFormat;
76    VkFormatFeatureFlags             formatFeatures;
77    VkComponentMapping               samplerYcbcrConversionComponents;
78    VkSamplerYcbcrModelConversion    suggestedYcbcrModel;
79    VkSamplerYcbcrRange              suggestedYcbcrRange;
80    VkChromaLocation                 suggestedXChromaOffset;
81    VkChromaLocation                 suggestedYChromaOffset;
82} VkAndroidHardwareBufferFormatPropertiesANDROID;
83
84typedef struct VkImportAndroidHardwareBufferInfoANDROID {
85    VkStructureType            sType;
86    const void*                pNext;
87    struct AHardwareBuffer*    buffer;
88} VkImportAndroidHardwareBufferInfoANDROID;
89
90typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
91    VkStructureType    sType;
92    const void*        pNext;
93    VkDeviceMemory     memory;
94} VkMemoryGetAndroidHardwareBufferInfoANDROID;
95
96typedef struct VkExternalFormatANDROID {
97    VkStructureType    sType;
98    void*              pNext;
99    uint64_t           externalFormat;
100} VkExternalFormatANDROID;
101
102typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
103typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
104
105#ifndef VK_NO_PROTOTYPES
106VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
107    VkDevice                                    device,
108    const struct AHardwareBuffer*               buffer,
109    VkAndroidHardwareBufferPropertiesANDROID*   pProperties);
110
111VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
112    VkDevice                                    device,
113    const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
114    struct AHardwareBuffer**                    pBuffer);
115#endif
116
117#ifdef __cplusplus
118}
119#endif
120
121#endif
122