• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2022 The Android Open Source Project
2 // Copyright (C) 2022 Google Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // Autogenerated header vk_android_native_buffer.h
17 // Please do not modify directly;
18 // re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
19 // or directly from Python by calling the genvk.py script with correct parameters.
20 
21 #pragma once
22 #ifndef VK_ANDROID_native_buffer
23 #include "vk_android_native_buffer_structure_type.h"
24 #endif /* VK_ANDROID_native_buffer */
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #ifndef VK_ANDROID_native_buffer
31 
32 #define VK_ANDROID_native_buffer 1
33 #define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 8
34 #define VK_ANDROID_NATIVE_BUFFER_NUMBER 11
35 #define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME "VK_ANDROID_native_buffer"
36 #define VK_ANDROID_NATIVE_BUFFER_NAME VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME
37 
38 typedef enum VkSwapchainImageUsageFlagBitsANDROID {
39     VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0x00000001,
40     VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM_ANDROID = 0x7FFFFFFF
41 } VkSwapchainImageUsageFlagBitsANDROID;
42 typedef VkFlags VkSwapchainImageUsageFlagsANDROID;
43 typedef struct VkNativeBufferUsage2ANDROID {
44     uint64_t consumer;
45     uint64_t producer;
46 } VkNativeBufferUsage2ANDROID;
47 
48 typedef struct VkNativeBufferANDROID {
49     VkStructureType sType;
50     const void* pNext;
51     const uint32_t* handle;
52     int stride;
53     int format;
54     int usage;
55     VkNativeBufferUsage2ANDROID usage2;
56 } VkNativeBufferANDROID;
57 
58 typedef struct VkSwapchainImageCreateInfoANDROID {
59     VkStructureType sType;
60     const void* pNext;
61     VkSwapchainImageUsageFlagsANDROID usage;
62 } VkSwapchainImageCreateInfoANDROID;
63 
64 typedef struct VkPhysicalDevicePresentationPropertiesANDROID {
65     VkStructureType sType;
66     const void* pNext;
67     VkBool32 sharedImage;
68 } VkPhysicalDevicePresentationPropertiesANDROID;
69 
70 typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainGrallocUsageANDROID)(VkDevice device, VkFormat format,
71                                                                    VkImageUsageFlags imageUsage,
72                                                                    int* grallocUsage);
73 typedef VkResult(VKAPI_PTR* PFN_vkAcquireImageANDROID)(VkDevice device, VkImage image,
74                                                        int nativeFenceFd, VkSemaphore semaphore,
75                                                        VkFence fence);
76 typedef VkResult(VKAPI_PTR* PFN_vkQueueSignalReleaseImageANDROID)(
77     VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image,
78     int* pNativeFenceFd);
79 typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainGrallocUsage2ANDROID)(
80     VkDevice device, VkFormat format, VkImageUsageFlags imageUsage,
81     VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage,
82     uint64_t* grallocProducerUsage);
83 
84 #ifndef VK_NO_PROTOTYPES
85 VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format,
86                                                                  VkImageUsageFlags imageUsage,
87                                                                  int* grallocUsage);
88 
89 VKAPI_ATTR VkResult VKAPI_CALL vkAcquireImageANDROID(VkDevice device, VkImage image,
90                                                      int nativeFenceFd, VkSemaphore semaphore,
91                                                      VkFence fence);
92 
93 VKAPI_ATTR VkResult VKAPI_CALL vkQueueSignalReleaseImageANDROID(VkQueue queue,
94                                                                 uint32_t waitSemaphoreCount,
95                                                                 const VkSemaphore* pWaitSemaphores,
96                                                                 VkImage image, int* pNativeFenceFd);
97 
98 VKAPI_ATTR VkResult VKAPI_CALL
99 vkGetSwapchainGrallocUsage2ANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage,
100                                    VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
101                                    uint64_t* grallocConsumerUsage, uint64_t* grallocProducerUsage);
102 #endif
103 #endif /* VK_ANDROID_native_buffer */
104 
105 #ifdef __cplusplus
106 }
107 #endif
108