xref: /aosp_15_r20/external/swiftshader/include/vulkan/vulkan_android.h (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
1*03ce13f7SAndroid Build Coastguard Worker #ifndef VULKAN_ANDROID_H_
2*03ce13f7SAndroid Build Coastguard Worker #define VULKAN_ANDROID_H_ 1
3*03ce13f7SAndroid Build Coastguard Worker 
4*03ce13f7SAndroid Build Coastguard Worker /*
5*03ce13f7SAndroid Build Coastguard Worker ** Copyright 2015-2024 The Khronos Group Inc.
6*03ce13f7SAndroid Build Coastguard Worker **
7*03ce13f7SAndroid Build Coastguard Worker ** SPDX-License-Identifier: Apache-2.0
8*03ce13f7SAndroid Build Coastguard Worker */
9*03ce13f7SAndroid Build Coastguard Worker 
10*03ce13f7SAndroid Build Coastguard Worker /*
11*03ce13f7SAndroid Build Coastguard Worker ** This header is generated from the Khronos Vulkan XML API Registry.
12*03ce13f7SAndroid Build Coastguard Worker **
13*03ce13f7SAndroid Build Coastguard Worker */
14*03ce13f7SAndroid Build Coastguard Worker 
15*03ce13f7SAndroid Build Coastguard Worker 
16*03ce13f7SAndroid Build Coastguard Worker #ifdef __cplusplus
17*03ce13f7SAndroid Build Coastguard Worker extern "C" {
18*03ce13f7SAndroid Build Coastguard Worker #endif
19*03ce13f7SAndroid Build Coastguard Worker 
20*03ce13f7SAndroid Build Coastguard Worker 
21*03ce13f7SAndroid Build Coastguard Worker 
22*03ce13f7SAndroid Build Coastguard Worker // VK_KHR_android_surface is a preprocessor guard. Do not pass it to API calls.
23*03ce13f7SAndroid Build Coastguard Worker #define VK_KHR_android_surface 1
24*03ce13f7SAndroid Build Coastguard Worker struct ANativeWindow;
25*03ce13f7SAndroid Build Coastguard Worker #define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
26*03ce13f7SAndroid Build Coastguard Worker #define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
27*03ce13f7SAndroid Build Coastguard Worker typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
28*03ce13f7SAndroid Build Coastguard Worker typedef struct VkAndroidSurfaceCreateInfoKHR {
29*03ce13f7SAndroid Build Coastguard Worker     VkStructureType                   sType;
30*03ce13f7SAndroid Build Coastguard Worker     const void*                       pNext;
31*03ce13f7SAndroid Build Coastguard Worker     VkAndroidSurfaceCreateFlagsKHR    flags;
32*03ce13f7SAndroid Build Coastguard Worker     struct ANativeWindow*             window;
33*03ce13f7SAndroid Build Coastguard Worker } VkAndroidSurfaceCreateInfoKHR;
34*03ce13f7SAndroid Build Coastguard Worker 
35*03ce13f7SAndroid Build Coastguard Worker typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
36*03ce13f7SAndroid Build Coastguard Worker 
37*03ce13f7SAndroid Build Coastguard Worker #ifndef VK_NO_PROTOTYPES
38*03ce13f7SAndroid Build Coastguard Worker VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
39*03ce13f7SAndroid Build Coastguard Worker     VkInstance                                  instance,
40*03ce13f7SAndroid Build Coastguard Worker     const VkAndroidSurfaceCreateInfoKHR*        pCreateInfo,
41*03ce13f7SAndroid Build Coastguard Worker     const VkAllocationCallbacks*                pAllocator,
42*03ce13f7SAndroid Build Coastguard Worker     VkSurfaceKHR*                               pSurface);
43*03ce13f7SAndroid Build Coastguard Worker #endif
44*03ce13f7SAndroid Build Coastguard Worker 
45*03ce13f7SAndroid Build Coastguard Worker 
46*03ce13f7SAndroid Build Coastguard Worker // VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls.
47*03ce13f7SAndroid Build Coastguard Worker #define VK_ANDROID_external_memory_android_hardware_buffer 1
48*03ce13f7SAndroid Build Coastguard Worker struct AHardwareBuffer;
49*03ce13f7SAndroid Build Coastguard Worker #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
50*03ce13f7SAndroid Build Coastguard Worker #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
51*03ce13f7SAndroid Build Coastguard Worker typedef struct VkAndroidHardwareBufferUsageANDROID {
52*03ce13f7SAndroid Build Coastguard Worker     VkStructureType    sType;
53*03ce13f7SAndroid Build Coastguard Worker     void*              pNext;
54*03ce13f7SAndroid Build Coastguard Worker     uint64_t           androidHardwareBufferUsage;
55*03ce13f7SAndroid Build Coastguard Worker } VkAndroidHardwareBufferUsageANDROID;
56*03ce13f7SAndroid Build Coastguard Worker 
57*03ce13f7SAndroid Build Coastguard Worker typedef struct VkAndroidHardwareBufferPropertiesANDROID {
58*03ce13f7SAndroid Build Coastguard Worker     VkStructureType    sType;
59*03ce13f7SAndroid Build Coastguard Worker     void*              pNext;
60*03ce13f7SAndroid Build Coastguard Worker     VkDeviceSize       allocationSize;
61*03ce13f7SAndroid Build Coastguard Worker     uint32_t           memoryTypeBits;
62*03ce13f7SAndroid Build Coastguard Worker } VkAndroidHardwareBufferPropertiesANDROID;
63*03ce13f7SAndroid Build Coastguard Worker 
64*03ce13f7SAndroid Build Coastguard Worker typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
65*03ce13f7SAndroid Build Coastguard Worker     VkStructureType                  sType;
66*03ce13f7SAndroid Build Coastguard Worker     void*                            pNext;
67*03ce13f7SAndroid Build Coastguard Worker     VkFormat                         format;
68*03ce13f7SAndroid Build Coastguard Worker     uint64_t                         externalFormat;
69*03ce13f7SAndroid Build Coastguard Worker     VkFormatFeatureFlags             formatFeatures;
70*03ce13f7SAndroid Build Coastguard Worker     VkComponentMapping               samplerYcbcrConversionComponents;
71*03ce13f7SAndroid Build Coastguard Worker     VkSamplerYcbcrModelConversion    suggestedYcbcrModel;
72*03ce13f7SAndroid Build Coastguard Worker     VkSamplerYcbcrRange              suggestedYcbcrRange;
73*03ce13f7SAndroid Build Coastguard Worker     VkChromaLocation                 suggestedXChromaOffset;
74*03ce13f7SAndroid Build Coastguard Worker     VkChromaLocation                 suggestedYChromaOffset;
75*03ce13f7SAndroid Build Coastguard Worker } VkAndroidHardwareBufferFormatPropertiesANDROID;
76*03ce13f7SAndroid Build Coastguard Worker 
77*03ce13f7SAndroid Build Coastguard Worker typedef struct VkImportAndroidHardwareBufferInfoANDROID {
78*03ce13f7SAndroid Build Coastguard Worker     VkStructureType            sType;
79*03ce13f7SAndroid Build Coastguard Worker     const void*                pNext;
80*03ce13f7SAndroid Build Coastguard Worker     struct AHardwareBuffer*    buffer;
81*03ce13f7SAndroid Build Coastguard Worker } VkImportAndroidHardwareBufferInfoANDROID;
82*03ce13f7SAndroid Build Coastguard Worker 
83*03ce13f7SAndroid Build Coastguard Worker typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
84*03ce13f7SAndroid Build Coastguard Worker     VkStructureType    sType;
85*03ce13f7SAndroid Build Coastguard Worker     const void*        pNext;
86*03ce13f7SAndroid Build Coastguard Worker     VkDeviceMemory     memory;
87*03ce13f7SAndroid Build Coastguard Worker } VkMemoryGetAndroidHardwareBufferInfoANDROID;
88*03ce13f7SAndroid Build Coastguard Worker 
89*03ce13f7SAndroid Build Coastguard Worker typedef struct VkExternalFormatANDROID {
90*03ce13f7SAndroid Build Coastguard Worker     VkStructureType    sType;
91*03ce13f7SAndroid Build Coastguard Worker     void*              pNext;
92*03ce13f7SAndroid Build Coastguard Worker     uint64_t           externalFormat;
93*03ce13f7SAndroid Build Coastguard Worker } VkExternalFormatANDROID;
94*03ce13f7SAndroid Build Coastguard Worker 
95*03ce13f7SAndroid Build Coastguard Worker typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
96*03ce13f7SAndroid Build Coastguard Worker     VkStructureType                  sType;
97*03ce13f7SAndroid Build Coastguard Worker     void*                            pNext;
98*03ce13f7SAndroid Build Coastguard Worker     VkFormat                         format;
99*03ce13f7SAndroid Build Coastguard Worker     uint64_t                         externalFormat;
100*03ce13f7SAndroid Build Coastguard Worker     VkFormatFeatureFlags2            formatFeatures;
101*03ce13f7SAndroid Build Coastguard Worker     VkComponentMapping               samplerYcbcrConversionComponents;
102*03ce13f7SAndroid Build Coastguard Worker     VkSamplerYcbcrModelConversion    suggestedYcbcrModel;
103*03ce13f7SAndroid Build Coastguard Worker     VkSamplerYcbcrRange              suggestedYcbcrRange;
104*03ce13f7SAndroid Build Coastguard Worker     VkChromaLocation                 suggestedXChromaOffset;
105*03ce13f7SAndroid Build Coastguard Worker     VkChromaLocation                 suggestedYChromaOffset;
106*03ce13f7SAndroid Build Coastguard Worker } VkAndroidHardwareBufferFormatProperties2ANDROID;
107*03ce13f7SAndroid Build Coastguard Worker 
108*03ce13f7SAndroid Build Coastguard Worker typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
109*03ce13f7SAndroid Build Coastguard Worker typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
110*03ce13f7SAndroid Build Coastguard Worker 
111*03ce13f7SAndroid Build Coastguard Worker #ifndef VK_NO_PROTOTYPES
112*03ce13f7SAndroid Build Coastguard Worker VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
113*03ce13f7SAndroid Build Coastguard Worker     VkDevice                                    device,
114*03ce13f7SAndroid Build Coastguard Worker     const struct AHardwareBuffer*               buffer,
115*03ce13f7SAndroid Build Coastguard Worker     VkAndroidHardwareBufferPropertiesANDROID*   pProperties);
116*03ce13f7SAndroid Build Coastguard Worker 
117*03ce13f7SAndroid Build Coastguard Worker VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
118*03ce13f7SAndroid Build Coastguard Worker     VkDevice                                    device,
119*03ce13f7SAndroid Build Coastguard Worker     const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
120*03ce13f7SAndroid Build Coastguard Worker     struct AHardwareBuffer**                    pBuffer);
121*03ce13f7SAndroid Build Coastguard Worker #endif
122*03ce13f7SAndroid Build Coastguard Worker 
123*03ce13f7SAndroid Build Coastguard Worker 
124*03ce13f7SAndroid Build Coastguard Worker // VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls.
125*03ce13f7SAndroid Build Coastguard Worker #define VK_ANDROID_external_format_resolve 1
126*03ce13f7SAndroid Build Coastguard Worker #define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_SPEC_VERSION 1
127*03ce13f7SAndroid Build Coastguard Worker #define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME "VK_ANDROID_external_format_resolve"
128*03ce13f7SAndroid Build Coastguard Worker typedef struct VkPhysicalDeviceExternalFormatResolveFeaturesANDROID {
129*03ce13f7SAndroid Build Coastguard Worker     VkStructureType    sType;
130*03ce13f7SAndroid Build Coastguard Worker     void*              pNext;
131*03ce13f7SAndroid Build Coastguard Worker     VkBool32           externalFormatResolve;
132*03ce13f7SAndroid Build Coastguard Worker } VkPhysicalDeviceExternalFormatResolveFeaturesANDROID;
133*03ce13f7SAndroid Build Coastguard Worker 
134*03ce13f7SAndroid Build Coastguard Worker typedef struct VkPhysicalDeviceExternalFormatResolvePropertiesANDROID {
135*03ce13f7SAndroid Build Coastguard Worker     VkStructureType     sType;
136*03ce13f7SAndroid Build Coastguard Worker     void*               pNext;
137*03ce13f7SAndroid Build Coastguard Worker     VkBool32            nullColorAttachmentWithExternalFormatResolve;
138*03ce13f7SAndroid Build Coastguard Worker     VkChromaLocation    externalFormatResolveChromaOffsetX;
139*03ce13f7SAndroid Build Coastguard Worker     VkChromaLocation    externalFormatResolveChromaOffsetY;
140*03ce13f7SAndroid Build Coastguard Worker } VkPhysicalDeviceExternalFormatResolvePropertiesANDROID;
141*03ce13f7SAndroid Build Coastguard Worker 
142*03ce13f7SAndroid Build Coastguard Worker typedef struct VkAndroidHardwareBufferFormatResolvePropertiesANDROID {
143*03ce13f7SAndroid Build Coastguard Worker     VkStructureType    sType;
144*03ce13f7SAndroid Build Coastguard Worker     void*              pNext;
145*03ce13f7SAndroid Build Coastguard Worker     VkFormat           colorAttachmentFormat;
146*03ce13f7SAndroid Build Coastguard Worker } VkAndroidHardwareBufferFormatResolvePropertiesANDROID;
147*03ce13f7SAndroid Build Coastguard Worker 
148*03ce13f7SAndroid Build Coastguard Worker 
149*03ce13f7SAndroid Build Coastguard Worker #ifdef __cplusplus
150*03ce13f7SAndroid Build Coastguard Worker }
151*03ce13f7SAndroid Build Coastguard Worker #endif
152*03ce13f7SAndroid Build Coastguard Worker 
153*03ce13f7SAndroid Build Coastguard Worker #endif
154