Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1 | // Copyright (C) 2018 The Android Open Source Project |
| 2 | // Copyright (C) 2018 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. |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15 | #pragma once |
| 16 | |
Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17 | #include "android/base/Tracing.h" |
| 18 | |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19 | #include <vulkan/vulkan.h> |
| 20 | |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21 | #include "VulkanHandleMapping.h" |
Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 22 | #include "VulkanHandles.h" |
Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 23 | #include <functional> |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 24 | #include <memory> |
| 25 | |
Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 26 | #include "goldfish_vk_transform_guest.h" |
| 27 | |
Lingfeng Yang | 3175463 | 2018-12-21 18:24:55 -0800 | [diff] [blame] | 28 | struct EmulatorFeatureInfo; |
| 29 | |
Lingfeng Yang | 34b5cae | 2019-08-21 14:12:19 -0700 | [diff] [blame] | 30 | class HostConnection; |
| 31 | |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 32 | namespace goldfish_vk { |
| 33 | |
Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 34 | class VkEncoder; |
| 35 | |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 36 | class ResourceTracker { |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 37 | public: |
| 38 | ResourceTracker(); |
Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 39 | virtual ~ResourceTracker(); |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 40 | static ResourceTracker* get(); |
Lingfeng Yang | 4032911 | 2021-01-22 18:01:43 -0800 | [diff] [blame] | 41 | |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 42 | VulkanHandleMapping* createMapping(); |
| 43 | VulkanHandleMapping* unwrapMapping(); |
| 44 | VulkanHandleMapping* destroyMapping(); |
Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 45 | VulkanHandleMapping* defaultMapping(); |
Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 46 | |
Lingfeng Yang | 34b5cae | 2019-08-21 14:12:19 -0700 | [diff] [blame] | 47 | using HostConnectionGetFunc = HostConnection* (*)(); |
Lingfeng Yang | cd2d8fe | 2019-08-16 12:21:50 -0700 | [diff] [blame] | 48 | using VkEncoderGetFunc = VkEncoder* (*)(HostConnection*); |
Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 49 | using CleanupCallback = std::function<void()>; |
Lingfeng Yang | 34b5cae | 2019-08-21 14:12:19 -0700 | [diff] [blame] | 50 | |
| 51 | struct ThreadingCallbacks { |
| 52 | HostConnectionGetFunc hostConnectionGetFunc = 0; |
Lingfeng Yang | cd2d8fe | 2019-08-16 12:21:50 -0700 | [diff] [blame] | 53 | VkEncoderGetFunc vkEncoderGetFunc = 0; |
Lingfeng Yang | 34b5cae | 2019-08-21 14:12:19 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
Lingfeng Yang | 4032911 | 2021-01-22 18:01:43 -0800 | [diff] [blame] | 56 | static uint32_t streamFeatureBits; |
| 57 | static ThreadingCallbacks threadingCallbacks; |
| 58 | |
Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 59 | #define HANDLE_REGISTER_DECL(type) \ |
| 60 | void register_##type(type); \ |
| 61 | void unregister_##type(type); \ |
| 62 | |
| 63 | GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_DECL) |
| 64 | |
Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 65 | VkResult on_vkEnumerateInstanceExtensionProperties( |
| 66 | void* context, |
| 67 | VkResult input_result, |
| 68 | const char* pLayerName, |
| 69 | uint32_t* pPropertyCount, |
| 70 | VkExtensionProperties* pProperties); |
| 71 | |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 72 | VkResult on_vkEnumerateDeviceExtensionProperties( |
| 73 | void* context, |
| 74 | VkResult input_result, |
| 75 | VkPhysicalDevice physicalDevice, |
| 76 | const char* pLayerName, |
| 77 | uint32_t* pPropertyCount, |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 78 | VkExtensionProperties* pProperties); |
Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 79 | |
Lingfeng Yang | b64ca45 | 2019-02-14 22:04:28 -0800 | [diff] [blame] | 80 | VkResult on_vkEnumeratePhysicalDevices( |
| 81 | void* context, VkResult input_result, |
| 82 | VkInstance instance, uint32_t* pPhysicalDeviceCount, |
| 83 | VkPhysicalDevice* pPhysicalDevices); |
| 84 | |
Yahan Zhou | 7b99a38 | 2022-04-13 15:25:46 -0700 | [diff] [blame] | 85 | void on_vkGetPhysicalDeviceFeatures2( |
| 86 | void* context, |
| 87 | VkPhysicalDevice physicalDevice, |
| 88 | VkPhysicalDeviceFeatures2* pFeatures); |
| 89 | void on_vkGetPhysicalDeviceFeatures2KHR( |
| 90 | void* context, |
| 91 | VkPhysicalDevice physicalDevice, |
| 92 | VkPhysicalDeviceFeatures2* pFeatures); |
Yilong Li | f336908 | 2020-06-25 03:39:24 -0700 | [diff] [blame] | 93 | void on_vkGetPhysicalDeviceProperties( |
| 94 | void* context, |
| 95 | VkPhysicalDevice physicalDevice, |
| 96 | VkPhysicalDeviceProperties* pProperties); |
| 97 | void on_vkGetPhysicalDeviceProperties2( |
| 98 | void* context, |
| 99 | VkPhysicalDevice physicalDevice, |
| 100 | VkPhysicalDeviceProperties2* pProperties); |
| 101 | void on_vkGetPhysicalDeviceProperties2KHR( |
| 102 | void* context, |
| 103 | VkPhysicalDevice physicalDevice, |
| 104 | VkPhysicalDeviceProperties2* pProperties); |
| 105 | |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 106 | void on_vkGetPhysicalDeviceMemoryProperties( |
| 107 | void* context, |
| 108 | VkPhysicalDevice physicalDevice, |
| 109 | VkPhysicalDeviceMemoryProperties* pMemoryProperties); |
Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 110 | void on_vkGetPhysicalDeviceMemoryProperties2( |
| 111 | void* context, |
| 112 | VkPhysicalDevice physicalDevice, |
| 113 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties); |
| 114 | void on_vkGetPhysicalDeviceMemoryProperties2KHR( |
| 115 | void* context, |
| 116 | VkPhysicalDevice physicalDevice, |
| 117 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties); |
Yilong Li | 366c366 | 2021-04-25 03:38:14 -0700 | [diff] [blame] | 118 | void on_vkGetDeviceQueue(void* context, |
| 119 | VkDevice device, |
| 120 | uint32_t queueFamilyIndex, |
| 121 | uint32_t queueIndex, |
| 122 | VkQueue* pQueue); |
| 123 | void on_vkGetDeviceQueue2(void* context, |
| 124 | VkDevice device, |
| 125 | const VkDeviceQueueInfo2* pQueueInfo, |
| 126 | VkQueue* pQueue); |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 127 | |
Lingfeng Yang | f0654ff | 2019-02-02 12:21:24 -0800 | [diff] [blame] | 128 | VkResult on_vkCreateInstance( |
| 129 | void* context, |
| 130 | VkResult input_result, |
| 131 | const VkInstanceCreateInfo* createInfo, |
| 132 | const VkAllocationCallbacks* pAllocator, |
| 133 | VkInstance* pInstance); |
Lingfeng Yang | 131d5a4 | 2018-11-30 12:00:33 -0800 | [diff] [blame] | 134 | VkResult on_vkCreateDevice( |
| 135 | void* context, |
| 136 | VkResult input_result, |
| 137 | VkPhysicalDevice physicalDevice, |
| 138 | const VkDeviceCreateInfo* pCreateInfo, |
| 139 | const VkAllocationCallbacks* pAllocator, |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 140 | VkDevice* pDevice); |
Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 141 | void on_vkDestroyDevice_pre( |
| 142 | void* context, |
| 143 | VkDevice device, |
| 144 | const VkAllocationCallbacks* pAllocator); |
Lingfeng Yang | 131d5a4 | 2018-11-30 12:00:33 -0800 | [diff] [blame] | 145 | |
| 146 | VkResult on_vkAllocateMemory( |
| 147 | void* context, |
| 148 | VkResult input_result, |
| 149 | VkDevice device, |
| 150 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 151 | const VkAllocationCallbacks* pAllocator, |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 152 | VkDeviceMemory* pMemory); |
Lingfeng Yang | e997952 | 2018-12-25 14:44:52 -0800 | [diff] [blame] | 153 | void on_vkFreeMemory( |
| 154 | void* context, |
| 155 | VkDevice device, |
| 156 | VkDeviceMemory memory, |
| 157 | const VkAllocationCallbacks* pAllocator); |
Lingfeng Yang | 131d5a4 | 2018-11-30 12:00:33 -0800 | [diff] [blame] | 158 | |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 159 | VkResult on_vkMapMemory( |
| 160 | void* context, |
| 161 | VkResult input_result, |
| 162 | VkDevice device, |
| 163 | VkDeviceMemory memory, |
| 164 | VkDeviceSize offset, |
| 165 | VkDeviceSize size, |
| 166 | VkMemoryMapFlags, |
| 167 | void** ppData); |
| 168 | |
| 169 | void on_vkUnmapMemory( |
| 170 | void* context, |
| 171 | VkDevice device, |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 172 | VkDeviceMemory memory); |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 173 | |
Lingfeng Yang | 4af5f32 | 2019-02-14 08:10:28 -0800 | [diff] [blame] | 174 | VkResult on_vkCreateImage( |
| 175 | void* context, VkResult input_result, |
| 176 | VkDevice device, const VkImageCreateInfo *pCreateInfo, |
| 177 | const VkAllocationCallbacks *pAllocator, |
| 178 | VkImage *pImage); |
| 179 | void on_vkDestroyImage( |
| 180 | void* context, |
| 181 | VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator); |
| 182 | |
| 183 | void on_vkGetImageMemoryRequirements( |
| 184 | void *context, VkDevice device, VkImage image, |
| 185 | VkMemoryRequirements *pMemoryRequirements); |
| 186 | void on_vkGetImageMemoryRequirements2( |
| 187 | void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, |
| 188 | VkMemoryRequirements2 *pMemoryRequirements); |
| 189 | void on_vkGetImageMemoryRequirements2KHR( |
| 190 | void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, |
| 191 | VkMemoryRequirements2 *pMemoryRequirements); |
| 192 | |
| 193 | VkResult on_vkBindImageMemory( |
| 194 | void* context, VkResult input_result, |
| 195 | VkDevice device, VkImage image, VkDeviceMemory memory, |
| 196 | VkDeviceSize memoryOffset); |
| 197 | VkResult on_vkBindImageMemory2( |
| 198 | void* context, VkResult input_result, |
| 199 | VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos); |
| 200 | VkResult on_vkBindImageMemory2KHR( |
| 201 | void* context, VkResult input_result, |
| 202 | VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos); |
| 203 | |
| 204 | VkResult on_vkCreateBuffer( |
| 205 | void* context, VkResult input_result, |
| 206 | VkDevice device, const VkBufferCreateInfo *pCreateInfo, |
| 207 | const VkAllocationCallbacks *pAllocator, |
| 208 | VkBuffer *pBuffer); |
| 209 | void on_vkDestroyBuffer( |
| 210 | void* context, |
| 211 | VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator); |
| 212 | |
| 213 | void on_vkGetBufferMemoryRequirements( |
| 214 | void* context, VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements); |
| 215 | void on_vkGetBufferMemoryRequirements2( |
| 216 | void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, |
| 217 | VkMemoryRequirements2* pMemoryRequirements); |
| 218 | void on_vkGetBufferMemoryRequirements2KHR( |
| 219 | void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, |
| 220 | VkMemoryRequirements2* pMemoryRequirements); |
| 221 | |
| 222 | VkResult on_vkBindBufferMemory( |
| 223 | void* context, VkResult input_result, |
| 224 | VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); |
| 225 | VkResult on_vkBindBufferMemory2( |
| 226 | void* context, VkResult input_result, |
| 227 | VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos); |
| 228 | VkResult on_vkBindBufferMemory2KHR( |
| 229 | void* context, VkResult input_result, |
| 230 | VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos); |
| 231 | |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 232 | VkResult on_vkCreateSemaphore( |
David Reveman | 32b110e | 2019-02-21 13:20:54 -0500 | [diff] [blame] | 233 | void* context, VkResult, |
| 234 | VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, |
| 235 | const VkAllocationCallbacks* pAllocator, |
| 236 | VkSemaphore* pSemaphore); |
| 237 | void on_vkDestroySemaphore( |
| 238 | void* context, |
| 239 | VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator); |
Yahan Zhou | a499e44 | 2019-02-26 16:35:01 -0800 | [diff] [blame] | 240 | VkResult on_vkGetSemaphoreFdKHR( |
| 241 | void* context, VkResult, |
| 242 | VkDevice device, |
| 243 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 244 | int* pFd); |
| 245 | VkResult on_vkImportSemaphoreFdKHR( |
| 246 | void* context, VkResult, |
| 247 | VkDevice device, |
| 248 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); |
David Reveman | 32b110e | 2019-02-21 13:20:54 -0500 | [diff] [blame] | 249 | |
David Reveman | 2471022 | 2019-02-25 02:21:42 -0500 | [diff] [blame] | 250 | VkResult on_vkQueueSubmit( |
| 251 | void* context, VkResult input_result, |
| 252 | VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); |
| 253 | |
Lingfeng Yang | cd2d8fe | 2019-08-16 12:21:50 -0700 | [diff] [blame] | 254 | VkResult on_vkQueueWaitIdle( |
| 255 | void* context, VkResult input_result, |
| 256 | VkQueue queue); |
| 257 | |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 258 | void unwrap_VkNativeBufferANDROID( |
| 259 | const VkImageCreateInfo* pCreateInfo, |
| 260 | VkImageCreateInfo* local_pCreateInfo); |
| 261 | void unwrap_vkAcquireImageANDROID_nativeFenceFd(int fd, int* fd_out); |
| 262 | |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 263 | #ifdef VK_USE_PLATFORM_FUCHSIA |
David Reveman | ba51ee2 | 2019-03-26 11:22:21 -0400 | [diff] [blame] | 264 | VkResult on_vkGetMemoryZirconHandleFUCHSIA( |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 265 | void* context, VkResult input_result, |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 266 | VkDevice device, |
David Reveman | ba51ee2 | 2019-03-26 11:22:21 -0400 | [diff] [blame] | 267 | const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo, |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 268 | uint32_t* pHandle); |
David Reveman | 488704f | 2019-03-27 01:29:08 -0400 | [diff] [blame] | 269 | VkResult on_vkGetMemoryZirconHandlePropertiesFUCHSIA( |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 270 | void* context, VkResult input_result, |
| 271 | VkDevice device, |
David Reveman | 488704f | 2019-03-27 01:29:08 -0400 | [diff] [blame] | 272 | VkExternalMemoryHandleTypeFlagBits handleType, |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 273 | uint32_t handle, |
David Reveman | 488704f | 2019-03-27 01:29:08 -0400 | [diff] [blame] | 274 | VkMemoryZirconHandlePropertiesFUCHSIA* pProperties); |
David Reveman | ba51ee2 | 2019-03-26 11:22:21 -0400 | [diff] [blame] | 275 | VkResult on_vkGetSemaphoreZirconHandleFUCHSIA( |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 276 | void* context, VkResult input_result, |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 277 | VkDevice device, |
David Reveman | ba51ee2 | 2019-03-26 11:22:21 -0400 | [diff] [blame] | 278 | const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo, |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 279 | uint32_t* pHandle); |
David Reveman | ba51ee2 | 2019-03-26 11:22:21 -0400 | [diff] [blame] | 280 | VkResult on_vkImportSemaphoreZirconHandleFUCHSIA( |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 281 | void* context, VkResult input_result, |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 282 | VkDevice device, |
David Reveman | ba51ee2 | 2019-03-26 11:22:21 -0400 | [diff] [blame] | 283 | const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo); |
Yilong Li | e12328f | 2022-01-06 03:32:13 -0800 | [diff] [blame] | 284 | VkResult on_vkCreateBufferCollectionFUCHSIA( |
| 285 | void* context, |
| 286 | VkResult input_result, |
| 287 | VkDevice device, |
| 288 | const VkBufferCollectionCreateInfoFUCHSIA* pInfo, |
| 289 | const VkAllocationCallbacks* pAllocator, |
| 290 | VkBufferCollectionFUCHSIA* pCollection); |
| 291 | void on_vkDestroyBufferCollectionFUCHSIA( |
| 292 | void* context, |
| 293 | VkResult input_result, |
| 294 | VkDevice device, |
| 295 | VkBufferCollectionFUCHSIA collection, |
| 296 | const VkAllocationCallbacks* pAllocator); |
| 297 | VkResult on_vkSetBufferCollectionBufferConstraintsFUCHSIA( |
| 298 | void* context, |
| 299 | VkResult input_result, |
| 300 | VkDevice device, |
| 301 | VkBufferCollectionFUCHSIA collection, |
| 302 | const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo); |
| 303 | VkResult on_vkSetBufferCollectionImageConstraintsFUCHSIA( |
| 304 | void* context, |
| 305 | VkResult input_result, |
| 306 | VkDevice device, |
| 307 | VkBufferCollectionFUCHSIA collection, |
| 308 | const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo); |
| 309 | VkResult on_vkGetBufferCollectionPropertiesFUCHSIA( |
| 310 | void* context, |
| 311 | VkResult input_result, |
| 312 | VkDevice device, |
| 313 | VkBufferCollectionFUCHSIA collection, |
| 314 | VkBufferCollectionPropertiesFUCHSIA* pProperties); |
Gurchetan Singh | 4ea5e04 | 2022-10-25 16:08:28 +0000 | [diff] [blame] | 315 | VkResult on_vkCreateBufferCollectionFUCHSIAX( |
| 316 | void* context, |
| 317 | VkResult input_result, |
| 318 | VkDevice device, |
| 319 | const VkBufferCollectionCreateInfoFUCHSIAX* pInfo, |
| 320 | const VkAllocationCallbacks* pAllocator, |
| 321 | VkBufferCollectionFUCHSIAX* pCollection); |
| 322 | void on_vkDestroyBufferCollectionFUCHSIAX( |
| 323 | void* context, |
| 324 | VkResult input_result, |
| 325 | VkDevice device, |
| 326 | VkBufferCollectionFUCHSIAX collection, |
| 327 | const VkAllocationCallbacks* pAllocator); |
| 328 | VkResult on_vkSetBufferCollectionConstraintsFUCHSIAX( |
| 329 | void* context, |
| 330 | VkResult input_result, |
| 331 | VkDevice device, |
| 332 | VkBufferCollectionFUCHSIAX collection, |
| 333 | const VkImageCreateInfo* pImageInfo); |
| 334 | VkResult on_vkSetBufferCollectionBufferConstraintsFUCHSIAX( |
| 335 | void* context, |
| 336 | VkResult input_result, |
| 337 | VkDevice device, |
| 338 | VkBufferCollectionFUCHSIAX collection, |
| 339 | const VkBufferConstraintsInfoFUCHSIAX* pBufferConstraintsInfo); |
| 340 | VkResult on_vkSetBufferCollectionImageConstraintsFUCHSIAX( |
| 341 | void* context, |
| 342 | VkResult input_result, |
| 343 | VkDevice device, |
| 344 | VkBufferCollectionFUCHSIAX collection, |
| 345 | const VkImageConstraintsInfoFUCHSIAX* pImageConstraintsInfo); |
| 346 | VkResult on_vkGetBufferCollectionPropertiesFUCHSIAX( |
| 347 | void* context, |
| 348 | VkResult input_result, |
| 349 | VkDevice device, |
| 350 | VkBufferCollectionFUCHSIAX collection, |
| 351 | VkBufferCollectionPropertiesFUCHSIAX* pProperties); |
| 352 | VkResult on_vkGetBufferCollectionProperties2FUCHSIAX( |
| 353 | void* context, |
| 354 | VkResult input_result, |
| 355 | VkDevice device, |
| 356 | VkBufferCollectionFUCHSIAX collection, |
| 357 | VkBufferCollectionProperties2FUCHSIAX* pProperties); |
David Reveman | 5b7c584 | 2019-02-20 01:06:48 -0500 | [diff] [blame] | 358 | #endif |
| 359 | |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 360 | VkResult on_vkGetAndroidHardwareBufferPropertiesANDROID( |
| 361 | void* context, VkResult input_result, |
| 362 | VkDevice device, |
| 363 | const AHardwareBuffer* buffer, |
| 364 | VkAndroidHardwareBufferPropertiesANDROID* pProperties); |
| 365 | VkResult on_vkGetMemoryAndroidHardwareBufferANDROID( |
| 366 | void* context, VkResult input_result, |
| 367 | VkDevice device, |
| 368 | const VkMemoryGetAndroidHardwareBufferInfoANDROID *pInfo, |
| 369 | struct AHardwareBuffer** pBuffer); |
Lingfeng Yang | 4f3f91f | 2019-02-28 11:37:21 -0800 | [diff] [blame] | 370 | |
Lingfeng Yang | 5c70112 | 2019-03-05 08:34:46 -0800 | [diff] [blame] | 371 | VkResult on_vkCreateSamplerYcbcrConversion( |
| 372 | void* context, VkResult input_result, |
| 373 | VkDevice device, |
| 374 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 375 | const VkAllocationCallbacks* pAllocator, |
| 376 | VkSamplerYcbcrConversion* pYcbcrConversion); |
Roman Kiryanov | 004f48c | 2019-06-28 14:59:32 -0700 | [diff] [blame] | 377 | void on_vkDestroySamplerYcbcrConversion( |
| 378 | void* context, |
| 379 | VkDevice device, |
| 380 | VkSamplerYcbcrConversion ycbcrConversion, |
| 381 | const VkAllocationCallbacks* pAllocator); |
Lingfeng Yang | 5c70112 | 2019-03-05 08:34:46 -0800 | [diff] [blame] | 382 | VkResult on_vkCreateSamplerYcbcrConversionKHR( |
| 383 | void* context, VkResult input_result, |
| 384 | VkDevice device, |
| 385 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 386 | const VkAllocationCallbacks* pAllocator, |
| 387 | VkSamplerYcbcrConversion* pYcbcrConversion); |
Roman Kiryanov | 004f48c | 2019-06-28 14:59:32 -0700 | [diff] [blame] | 388 | void on_vkDestroySamplerYcbcrConversionKHR( |
| 389 | void* context, |
| 390 | VkDevice device, |
| 391 | VkSamplerYcbcrConversion ycbcrConversion, |
| 392 | const VkAllocationCallbacks* pAllocator); |
| 393 | |
| 394 | VkResult on_vkCreateSampler( |
| 395 | void* context, VkResult input_result, |
| 396 | VkDevice device, |
| 397 | const VkSamplerCreateInfo* pCreateInfo, |
| 398 | const VkAllocationCallbacks* pAllocator, |
| 399 | VkSampler* pSampler); |
Lingfeng Yang | 5c70112 | 2019-03-05 08:34:46 -0800 | [diff] [blame] | 400 | |
Lingfeng Yang | cd2d8fe | 2019-08-16 12:21:50 -0700 | [diff] [blame] | 401 | void on_vkGetPhysicalDeviceExternalFenceProperties( |
| 402 | void* context, |
| 403 | VkPhysicalDevice physicalDevice, |
| 404 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 405 | VkExternalFenceProperties* pExternalFenceProperties); |
| 406 | |
| 407 | void on_vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 408 | void* context, |
| 409 | VkPhysicalDevice physicalDevice, |
| 410 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 411 | VkExternalFenceProperties* pExternalFenceProperties); |
| 412 | |
| 413 | VkResult on_vkCreateFence( |
| 414 | void* context, |
| 415 | VkResult input_result, |
| 416 | VkDevice device, |
| 417 | const VkFenceCreateInfo* pCreateInfo, |
| 418 | const VkAllocationCallbacks* pAllocator, VkFence* pFence); |
| 419 | |
| 420 | void on_vkDestroyFence( |
| 421 | void* context, |
| 422 | VkDevice device, |
| 423 | VkFence fence, |
| 424 | const VkAllocationCallbacks* pAllocator); |
| 425 | |
| 426 | VkResult on_vkResetFences( |
| 427 | void* context, |
| 428 | VkResult input_result, |
| 429 | VkDevice device, |
| 430 | uint32_t fenceCount, |
| 431 | const VkFence* pFences); |
| 432 | |
| 433 | VkResult on_vkImportFenceFdKHR( |
| 434 | void* context, |
| 435 | VkResult input_result, |
| 436 | VkDevice device, |
| 437 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo); |
| 438 | |
| 439 | VkResult on_vkGetFenceFdKHR( |
| 440 | void* context, |
| 441 | VkResult input_result, |
| 442 | VkDevice device, |
| 443 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 444 | int* pFd); |
| 445 | |
| 446 | VkResult on_vkWaitForFences( |
| 447 | void* context, |
| 448 | VkResult input_result, |
| 449 | VkDevice device, |
| 450 | uint32_t fenceCount, |
| 451 | const VkFence* pFences, |
| 452 | VkBool32 waitAll, |
| 453 | uint64_t timeout); |
| 454 | |
Lingfeng Yang | e9e77d5 | 2020-03-25 14:01:58 -0700 | [diff] [blame] | 455 | VkResult on_vkCreateDescriptorPool( |
| 456 | void* context, |
| 457 | VkResult input_result, |
| 458 | VkDevice device, |
| 459 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 460 | const VkAllocationCallbacks* pAllocator, |
| 461 | VkDescriptorPool* pDescriptorPool); |
| 462 | |
| 463 | void on_vkDestroyDescriptorPool( |
| 464 | void* context, |
| 465 | VkDevice device, |
| 466 | VkDescriptorPool descriptorPool, |
| 467 | const VkAllocationCallbacks* pAllocator); |
| 468 | |
| 469 | VkResult on_vkResetDescriptorPool( |
| 470 | void* context, |
| 471 | VkResult input_result, |
| 472 | VkDevice device, |
| 473 | VkDescriptorPool descriptorPool, |
| 474 | VkDescriptorPoolResetFlags flags); |
| 475 | |
| 476 | VkResult on_vkAllocateDescriptorSets( |
| 477 | void* context, |
| 478 | VkResult input_result, |
| 479 | VkDevice device, |
| 480 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 481 | VkDescriptorSet* pDescriptorSets); |
| 482 | |
| 483 | VkResult on_vkFreeDescriptorSets( |
| 484 | void* context, |
| 485 | VkResult input_result, |
| 486 | VkDevice device, |
| 487 | VkDescriptorPool descriptorPool, |
| 488 | uint32_t descriptorSetCount, |
| 489 | const VkDescriptorSet* pDescriptorSets); |
| 490 | |
Lingfeng Yang | 03354c7 | 2020-03-26 13:00:51 -0700 | [diff] [blame] | 491 | VkResult on_vkCreateDescriptorSetLayout( |
| 492 | void* context, |
| 493 | VkResult input_result, |
| 494 | VkDevice device, |
| 495 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 496 | const VkAllocationCallbacks* pAllocator, |
| 497 | VkDescriptorSetLayout* pSetLayout); |
| 498 | |
| 499 | void on_vkUpdateDescriptorSets( |
| 500 | void* context, |
| 501 | VkDevice device, |
| 502 | uint32_t descriptorWriteCount, |
| 503 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 504 | uint32_t descriptorCopyCount, |
| 505 | const VkCopyDescriptorSet* pDescriptorCopies); |
| 506 | |
Lingfeng Yang | 236abc9 | 2018-12-21 20:19:33 -0800 | [diff] [blame] | 507 | VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE_pre( |
| 508 | void* context, |
| 509 | VkResult input_result, |
| 510 | VkDevice device, |
| 511 | VkDeviceMemory memory, |
| 512 | uint64_t* pAddress); |
| 513 | VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE( |
| 514 | void* context, |
| 515 | VkResult input_result, |
| 516 | VkDevice device, |
| 517 | VkDeviceMemory memory, |
| 518 | uint64_t* pAddress); |
| 519 | |
Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 520 | VkResult on_vkCreateDescriptorUpdateTemplate( |
| 521 | void* context, VkResult input_result, |
| 522 | VkDevice device, |
| 523 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 524 | const VkAllocationCallbacks* pAllocator, |
| 525 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); |
| 526 | |
| 527 | VkResult on_vkCreateDescriptorUpdateTemplateKHR( |
| 528 | void* context, VkResult input_result, |
| 529 | VkDevice device, |
| 530 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 531 | const VkAllocationCallbacks* pAllocator, |
| 532 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); |
| 533 | |
| 534 | void on_vkUpdateDescriptorSetWithTemplate( |
| 535 | void* context, |
| 536 | VkDevice device, |
| 537 | VkDescriptorSet descriptorSet, |
| 538 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 539 | const void* pData); |
| 540 | |
Lingfeng Yang | e517d1e | 2019-03-25 18:02:49 -0700 | [diff] [blame] | 541 | VkResult on_vkGetPhysicalDeviceImageFormatProperties2( |
| 542 | void* context, VkResult input_result, |
| 543 | VkPhysicalDevice physicalDevice, |
| 544 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 545 | VkImageFormatProperties2* pImageFormatProperties); |
| 546 | |
| 547 | VkResult on_vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 548 | void* context, VkResult input_result, |
| 549 | VkPhysicalDevice physicalDevice, |
| 550 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 551 | VkImageFormatProperties2* pImageFormatProperties); |
| 552 | |
Yilong Li | d1c6919 | 2021-02-05 02:06:07 -0800 | [diff] [blame] | 553 | void on_vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 554 | void* context, |
| 555 | VkPhysicalDevice physicalDevice, |
| 556 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 557 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties); |
| 558 | |
| 559 | void on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 560 | void* context, |
| 561 | VkPhysicalDevice physicalDevice, |
| 562 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 563 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties); |
| 564 | |
Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 565 | void registerEncoderCleanupCallback(const VkEncoder* encoder, void* handle, CleanupCallback callback); |
| 566 | void unregisterEncoderCleanupCallback(const VkEncoder* encoder, void* handle); |
| 567 | void onEncoderDeleted(const VkEncoder* encoder); |
| 568 | |
Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 569 | uint32_t syncEncodersForCommandBuffer(VkCommandBuffer commandBuffer, VkEncoder* current); |
Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 570 | uint32_t syncEncodersForQueue(VkQueue queue, VkEncoder* current); |
Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 571 | |
Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 572 | VkResult on_vkBeginCommandBuffer( |
| 573 | void* context, VkResult input_result, |
| 574 | VkCommandBuffer commandBuffer, |
| 575 | const VkCommandBufferBeginInfo* pBeginInfo); |
| 576 | VkResult on_vkEndCommandBuffer( |
| 577 | void* context, VkResult input_result, |
| 578 | VkCommandBuffer commandBuffer); |
| 579 | VkResult on_vkResetCommandBuffer( |
| 580 | void* context, VkResult input_result, |
| 581 | VkCommandBuffer commandBuffer, |
| 582 | VkCommandBufferResetFlags flags); |
| 583 | |
Roman Kiryanov | 6db11e5 | 2019-04-26 14:18:14 -0700 | [diff] [blame] | 584 | VkResult on_vkCreateImageView( |
| 585 | void* context, VkResult input_result, |
| 586 | VkDevice device, |
| 587 | const VkImageViewCreateInfo* pCreateInfo, |
| 588 | const VkAllocationCallbacks* pAllocator, |
| 589 | VkImageView* pView); |
| 590 | |
Lingfeng Yang | 967f9af | 2021-01-22 17:56:24 -0800 | [diff] [blame] | 591 | void on_vkCmdExecuteCommands( |
| 592 | void* context, |
| 593 | VkCommandBuffer commandBuffer, |
| 594 | uint32_t commandBufferCount, |
| 595 | const VkCommandBuffer* pCommandBuffers); |
| 596 | |
Lingfeng Yang | 55676e0 | 2021-02-08 08:39:45 -0800 | [diff] [blame] | 597 | void on_vkCmdBindDescriptorSets( |
| 598 | void* context, |
| 599 | VkCommandBuffer commandBuffer, |
| 600 | VkPipelineBindPoint pipelineBindPoint, |
| 601 | VkPipelineLayout layout, |
| 602 | uint32_t firstSet, |
| 603 | uint32_t descriptorSetCount, |
| 604 | const VkDescriptorSet* pDescriptorSets, |
| 605 | uint32_t dynamicOffsetCount, |
| 606 | const uint32_t* pDynamicOffsets); |
| 607 | |
| 608 | void on_vkDestroyDescriptorSetLayout( |
| 609 | void* context, |
| 610 | VkDevice device, |
| 611 | VkDescriptorSetLayout descriptorSetLayout, |
| 612 | const VkAllocationCallbacks* pAllocator); |
| 613 | |
Lingfeng Yang | 97f51af | 2021-04-22 12:24:11 -0700 | [diff] [blame] | 614 | VkResult on_vkAllocateCommandBuffers( |
| 615 | void* context, |
| 616 | VkResult input_result, |
| 617 | VkDevice device, |
| 618 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 619 | VkCommandBuffer* pCommandBuffers); |
| 620 | |
Lingfeng Yang | 084e534 | 2021-07-15 13:06:43 -0700 | [diff] [blame] | 621 | VkResult on_vkQueueSignalReleaseImageANDROID( |
| 622 | void* context, |
| 623 | VkResult input_result, |
| 624 | VkQueue queue, |
| 625 | uint32_t waitSemaphoreCount, |
| 626 | const VkSemaphore* pWaitSemaphores, |
| 627 | VkImage image, |
| 628 | int* pNativeFenceFd); |
| 629 | |
Yahan Zhou | 483ac02 | 2022-06-13 15:41:11 -0700 | [diff] [blame] | 630 | VkResult on_vkCreateGraphicsPipelines( |
| 631 | void* context, |
| 632 | VkResult input_result, |
| 633 | VkDevice device, |
| 634 | VkPipelineCache pipelineCache, |
| 635 | uint32_t createInfoCount, |
| 636 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 637 | const VkAllocationCallbacks* pAllocator, |
| 638 | VkPipeline* pPipelines); |
| 639 | |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 640 | uint8_t* getMappedPointer(VkDeviceMemory memory); |
| 641 | VkDeviceSize getMappedSize(VkDeviceMemory memory); |
Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 642 | VkDeviceSize getNonCoherentExtendedSize(VkDevice device, VkDeviceSize basicSize) const; |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 643 | bool isValidMemoryRange(const VkMappedMemoryRange& range) const; |
Lingfeng Yang | 3175463 | 2018-12-21 18:24:55 -0800 | [diff] [blame] | 644 | void setupFeatures(const EmulatorFeatureInfo* features); |
Lingfeng Yang | 34b5cae | 2019-08-21 14:12:19 -0700 | [diff] [blame] | 645 | void setThreadingCallbacks(const ThreadingCallbacks& callbacks); |
Lingfeng Yang | b8a38c7 | 2019-02-02 20:27:54 -0800 | [diff] [blame] | 646 | bool hostSupportsVulkan() const; |
Lingfeng Yang | 236abc9 | 2018-12-21 20:19:33 -0800 | [diff] [blame] | 647 | bool usingDirectMapping() const; |
Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 648 | uint32_t getStreamFeatures() const; |
Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 649 | uint32_t getApiVersionFromInstance(VkInstance instance) const; |
| 650 | uint32_t getApiVersionFromDevice(VkDevice device) const; |
| 651 | bool hasInstanceExtension(VkInstance instance, const std::string& name) const; |
| 652 | bool hasDeviceExtension(VkDevice instance, const std::string& name) const; |
Yahan Zhou | 97f37fa | 2022-04-28 21:57:17 +0000 | [diff] [blame] | 653 | VkDevice getDevice(VkCommandBuffer commandBuffer) const; |
Lingfeng Yang | 967f9af | 2021-01-22 17:56:24 -0800 | [diff] [blame] | 654 | void addToCommandPool(VkCommandPool commandPool, |
| 655 | uint32_t commandBufferCount, |
| 656 | VkCommandBuffer* pCommandBuffers); |
| 657 | void resetCommandPoolStagingInfo(VkCommandPool commandPool); |
| 658 | |
Gurchetan Singh | b7be316 | 2021-11-04 09:36:15 -0700 | [diff] [blame] | 659 | #ifdef __GNUC__ |
| 660 | #define ALWAYS_INLINE |
| 661 | #elif |
| 662 | #define ALWAYS_INLINE __attribute__((always_inline)) |
| 663 | #endif |
Lingfeng Yang | 967f9af | 2021-01-22 17:56:24 -0800 | [diff] [blame] | 664 | |
| 665 | static VkEncoder* getCommandBufferEncoder(VkCommandBuffer commandBuffer); |
| 666 | static VkEncoder* getQueueEncoder(VkQueue queue); |
| 667 | static VkEncoder* getThreadLocalEncoder(); |
Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 668 | |
Lingfeng Yang | db61655 | 2021-01-22 17:58:02 -0800 | [diff] [blame] | 669 | static void setSeqnoPtr(uint32_t* seqnoptr); |
Gurchetan Singh | b7be316 | 2021-11-04 09:36:15 -0700 | [diff] [blame] | 670 | static ALWAYS_INLINE uint32_t nextSeqno(); |
| 671 | static ALWAYS_INLINE uint32_t getSeqno(); |
Lingfeng Yang | db61655 | 2021-01-22 17:58:02 -0800 | [diff] [blame] | 672 | |
Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 673 | // Transforms |
Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 674 | void deviceMemoryTransform_tohost( |
| 675 | VkDeviceMemory* memory, uint32_t memoryCount, |
| 676 | VkDeviceSize* offset, uint32_t offsetCount, |
| 677 | VkDeviceSize* size, uint32_t sizeCount, |
| 678 | uint32_t* typeIndex, uint32_t typeIndexCount, |
| 679 | uint32_t* typeBits, uint32_t typeBitsCount); |
| 680 | void deviceMemoryTransform_fromhost( |
Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 681 | VkDeviceMemory* memory, uint32_t memoryCount, |
| 682 | VkDeviceSize* offset, uint32_t offsetCount, |
| 683 | VkDeviceSize* size, uint32_t sizeCount, |
| 684 | uint32_t* typeIndex, uint32_t typeIndexCount, |
| 685 | uint32_t* typeBits, uint32_t typeBitsCount); |
Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 686 | |
Yilong Li | dbc16d5 | 2021-02-04 03:15:21 -0800 | [diff] [blame] | 687 | void transformImpl_VkExternalMemoryProperties_fromhost( |
| 688 | VkExternalMemoryProperties* pProperties, |
| 689 | uint32_t); |
| 690 | void transformImpl_VkExternalMemoryProperties_tohost( |
| 691 | VkExternalMemoryProperties* pProperties, |
| 692 | uint32_t); |
Yilong Li | 353409a | 2022-01-04 02:37:56 -0800 | [diff] [blame] | 693 | void transformImpl_VkImageCreateInfo_fromhost(const VkImageCreateInfo*, uint32_t); |
| 694 | void transformImpl_VkImageCreateInfo_tohost(const VkImageCreateInfo*, uint32_t); |
Lingfeng Yang | 4af5f32 | 2019-02-14 08:10:28 -0800 | [diff] [blame] | 695 | |
Yilong Li | dbc16d5 | 2021-02-04 03:15:21 -0800 | [diff] [blame] | 696 | #define DEFINE_TRANSFORMED_TYPE_PROTOTYPE(type) \ |
| 697 | void transformImpl_##type##_tohost(type*, uint32_t); \ |
| 698 | void transformImpl_##type##_fromhost(type*, uint32_t); |
Lingfeng Yang | f0654ff | 2019-02-02 12:21:24 -0800 | [diff] [blame] | 699 | |
Yilong Li | d1c6919 | 2021-02-05 02:06:07 -0800 | [diff] [blame] | 700 | LIST_TRIVIAL_TRANSFORMED_TYPES(DEFINE_TRANSFORMED_TYPE_PROTOTYPE) |
Yilong Li | dbc16d5 | 2021-02-04 03:15:21 -0800 | [diff] [blame] | 701 | |
| 702 | private: |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 703 | class Impl; |
| 704 | std::unique_ptr<Impl> mImpl; |
| 705 | }; |
Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 706 | |
Lingfeng Yang | b8a38c7 | 2019-02-02 20:27:54 -0800 | [diff] [blame] | 707 | } // namespace goldfish_vk |