Jesse Hall | d02edcb | 2015-09-08 07:44:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 The Android Open Source Project |
| 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 | |
Trevor David Black | 0db7a09 | 2023-12-11 23:46:36 +0000 | [diff] [blame] | 17 | #include <android/hardware_buffer.h> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 18 | #include <hardware/hwvulkan.h> |
| 19 | |
Dan Albert | 1916513 | 2017-12-13 13:40:17 -0800 | [diff] [blame] | 20 | #include <errno.h> |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 21 | #include <inttypes.h> |
Jesse Hall | d3b1450 | 2016-04-20 16:58:11 -0700 | [diff] [blame] | 22 | #include <stdlib.h> |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 23 | #include <string.h> |
Steven Moreland | 54409a3 | 2017-07-17 11:49:21 -0700 | [diff] [blame] | 24 | #include <unistd.h> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 25 | |
Mark Salyzyn | a5e161b | 2016-09-29 08:08:05 -0700 | [diff] [blame] | 26 | #include <algorithm> |
| 27 | #include <array> |
| 28 | |
Mark Salyzyn | 7823e12 | 2016-09-29 08:08:05 -0700 | [diff] [blame] | 29 | #include <log/log.h> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 30 | |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 31 | #include "null_driver_gen.h" |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 32 | |
| 33 | using namespace null_driver; |
| 34 | |
| 35 | struct VkPhysicalDevice_T { |
| 36 | hwvulkan_dispatch_t dispatch; |
| 37 | }; |
| 38 | |
| 39 | struct VkInstance_T { |
| 40 | hwvulkan_dispatch_t dispatch; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 41 | VkAllocationCallbacks allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 42 | VkPhysicalDevice_T physical_device; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 43 | uint64_t next_callback_handle; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | struct VkQueue_T { |
| 47 | hwvulkan_dispatch_t dispatch; |
| 48 | }; |
| 49 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 50 | struct VkCommandBuffer_T { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 51 | hwvulkan_dispatch_t dispatch; |
| 52 | }; |
| 53 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 54 | namespace { |
| 55 | // Handles for non-dispatchable objects are either pointers, or arbitrary |
| 56 | // 64-bit non-zero values. We only use pointers when we need to keep state for |
| 57 | // the object even in a null driver. For the rest, we form a handle as: |
| 58 | // [63:63] = 1 to distinguish from pointer handles* |
| 59 | // [62:56] = non-zero handle type enum value |
| 60 | // [55: 0] = per-handle-type incrementing counter |
| 61 | // * This works because virtual addresses with the high bit set are reserved |
| 62 | // for kernel data in all ABIs we run on. |
| 63 | // |
| 64 | // We never reclaim handles on vkDestroy*. It's not even necessary for us to |
| 65 | // have distinct handles for live objects, and practically speaking we won't |
| 66 | // ever create 2^56 objects of the same type from a single VkDevice in a null |
| 67 | // driver. |
| 68 | // |
| 69 | // Using a namespace here instead of 'enum class' since we want scoped |
| 70 | // constants but also want implicit conversions to integral types. |
| 71 | namespace HandleType { |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 72 | enum Enum { |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 73 | kBufferView, |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 74 | kDebugReportCallbackEXT, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 75 | kDescriptorPool, |
| 76 | kDescriptorSet, |
| 77 | kDescriptorSetLayout, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 78 | kEvent, |
| 79 | kFence, |
| 80 | kFramebuffer, |
| 81 | kImageView, |
| 82 | kPipeline, |
| 83 | kPipelineCache, |
| 84 | kPipelineLayout, |
| 85 | kQueryPool, |
| 86 | kRenderPass, |
| 87 | kSampler, |
| 88 | kSemaphore, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 89 | kShaderModule, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 90 | |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 91 | kNumTypes |
| 92 | }; |
| 93 | } // namespace HandleType |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 94 | |
Jesse Hall | 00f10fe | 2016-02-08 21:20:20 -0800 | [diff] [blame] | 95 | const VkDeviceSize kMaxDeviceMemory = 0x10000000; // 256 MiB, arbitrary |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 96 | |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 97 | } // anonymous namespace |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 98 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 99 | struct VkDevice_T { |
| 100 | hwvulkan_dispatch_t dispatch; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 101 | VkAllocationCallbacks allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 102 | VkInstance_T* instance; |
| 103 | VkQueue_T queue; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 104 | std::array<uint64_t, HandleType::kNumTypes> next_handle; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 105 | }; |
| 106 | |
| 107 | // ----------------------------------------------------------------------------- |
| 108 | // Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device |
| 109 | // later. |
| 110 | |
| 111 | namespace { |
| 112 | int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device); |
| 113 | hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice}; |
| 114 | } // namespace |
| 115 | |
| 116 | #pragma clang diagnostic push |
| 117 | #pragma clang diagnostic ignored "-Wmissing-variable-declarations" |
| 118 | __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = { |
| 119 | .common = |
| 120 | { |
Michael Lentine | 03c64b0 | 2015-08-26 18:27:26 -0500 | [diff] [blame] | 121 | .tag = HARDWARE_MODULE_TAG, |
| 122 | .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1, |
| 123 | .hal_api_version = HARDWARE_HAL_API_VERSION, |
| 124 | .id = HWVULKAN_HARDWARE_MODULE_ID, |
| 125 | .name = "Null Vulkan Driver", |
| 126 | .author = "The Android Open Source Project", |
| 127 | .methods = &nulldrv_module_methods, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 128 | }, |
| 129 | }; |
| 130 | #pragma clang diagnostic pop |
| 131 | |
| 132 | // ----------------------------------------------------------------------------- |
| 133 | |
| 134 | namespace { |
| 135 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 136 | int CloseDevice(struct hw_device_t* /*device*/) { |
| 137 | // nothing to do - opening a device doesn't allocate any resources |
| 138 | return 0; |
| 139 | } |
| 140 | |
| 141 | hwvulkan_device_t nulldrv_device = { |
| 142 | .common = |
| 143 | { |
Michael Lentine | 03c64b0 | 2015-08-26 18:27:26 -0500 | [diff] [blame] | 144 | .tag = HARDWARE_DEVICE_TAG, |
| 145 | .version = HWVULKAN_DEVICE_API_VERSION_0_1, |
| 146 | .module = &HAL_MODULE_INFO_SYM.common, |
| 147 | .close = CloseDevice, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 148 | }, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 149 | .EnumerateInstanceExtensionProperties = |
| 150 | EnumerateInstanceExtensionProperties, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 151 | .CreateInstance = CreateInstance, |
| 152 | .GetInstanceProcAddr = GetInstanceProcAddr}; |
| 153 | |
| 154 | int OpenDevice(const hw_module_t* /*module*/, |
| 155 | const char* id, |
| 156 | hw_device_t** device) { |
| 157 | if (strcmp(id, HWVULKAN_DEVICE_0) == 0) { |
| 158 | *device = &nulldrv_device.common; |
| 159 | return 0; |
| 160 | } |
| 161 | return -ENOENT; |
| 162 | } |
| 163 | |
| 164 | VkInstance_T* GetInstanceFromPhysicalDevice( |
| 165 | VkPhysicalDevice_T* physical_device) { |
| 166 | return reinterpret_cast<VkInstance_T*>( |
| 167 | reinterpret_cast<uintptr_t>(physical_device) - |
| 168 | offsetof(VkInstance_T, physical_device)); |
| 169 | } |
| 170 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 171 | uint64_t AllocHandle(uint64_t type, uint64_t* next_handle) { |
| 172 | const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1; |
| 173 | ALOGE_IF(*next_handle == kHandleMask, |
| 174 | "non-dispatchable handles of type=%" PRIu64 |
| 175 | " are about to overflow", |
| 176 | type); |
| 177 | return (UINT64_C(1) << 63) | ((type & 0x7) << 56) | |
| 178 | ((*next_handle)++ & kHandleMask); |
| 179 | } |
| 180 | |
| 181 | template <class Handle> |
| 182 | Handle AllocHandle(VkInstance instance, HandleType::Enum type) { |
| 183 | return reinterpret_cast<Handle>( |
| 184 | AllocHandle(type, &instance->next_callback_handle)); |
| 185 | } |
| 186 | |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 187 | template <class Handle> |
| 188 | Handle AllocHandle(VkDevice device, HandleType::Enum type) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 189 | return reinterpret_cast<Handle>( |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 190 | AllocHandle(type, &device->next_handle[type])); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 191 | } |
| 192 | |
Jesse Hall | d3b1450 | 2016-04-20 16:58:11 -0700 | [diff] [blame] | 193 | VKAPI_ATTR void* DefaultAllocate(void*, |
| 194 | size_t size, |
| 195 | size_t alignment, |
| 196 | VkSystemAllocationScope) { |
| 197 | void* ptr = nullptr; |
| 198 | // Vulkan requires 'alignment' to be a power of two, but posix_memalign |
| 199 | // additionally requires that it be at least sizeof(void*). |
| 200 | int ret = posix_memalign(&ptr, std::max(alignment, sizeof(void*)), size); |
| 201 | return ret == 0 ? ptr : nullptr; |
| 202 | } |
| 203 | |
| 204 | VKAPI_ATTR void* DefaultReallocate(void*, |
| 205 | void* ptr, |
| 206 | size_t size, |
| 207 | size_t alignment, |
| 208 | VkSystemAllocationScope) { |
| 209 | if (size == 0) { |
| 210 | free(ptr); |
| 211 | return nullptr; |
| 212 | } |
| 213 | |
| 214 | // TODO(jessehall): Right now we never shrink allocations; if the new |
| 215 | // request is smaller than the existing chunk, we just continue using it. |
| 216 | // The null driver never reallocs, so this doesn't matter. If that changes, |
| 217 | // or if this code is copied into some other project, this should probably |
| 218 | // have a heuristic to allocate-copy-free when doing so will save "enough" |
| 219 | // space. |
| 220 | size_t old_size = ptr ? malloc_usable_size(ptr) : 0; |
| 221 | if (size <= old_size) |
| 222 | return ptr; |
| 223 | |
| 224 | void* new_ptr = nullptr; |
| 225 | if (posix_memalign(&new_ptr, std::max(alignment, sizeof(void*)), size) != 0) |
| 226 | return nullptr; |
| 227 | if (ptr) { |
| 228 | memcpy(new_ptr, ptr, std::min(old_size, size)); |
| 229 | free(ptr); |
| 230 | } |
| 231 | return new_ptr; |
| 232 | } |
| 233 | |
| 234 | VKAPI_ATTR void DefaultFree(void*, void* ptr) { |
| 235 | free(ptr); |
| 236 | } |
| 237 | |
| 238 | const VkAllocationCallbacks kDefaultAllocCallbacks = { |
| 239 | .pUserData = nullptr, |
| 240 | .pfnAllocation = DefaultAllocate, |
| 241 | .pfnReallocation = DefaultReallocate, |
| 242 | .pfnFree = DefaultFree, |
| 243 | }; |
| 244 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 245 | } // namespace |
| 246 | |
| 247 | namespace null_driver { |
| 248 | |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 249 | #define DEFINE_OBJECT_HANDLE_CONVERSION(T) \ |
| 250 | T* Get##T##FromHandle(Vk##T h); \ |
| 251 | T* Get##T##FromHandle(Vk##T h) { \ |
| 252 | return reinterpret_cast<T*>(uintptr_t(h)); \ |
| 253 | } \ |
| 254 | Vk##T GetHandleTo##T(const T* obj); \ |
| 255 | Vk##T GetHandleTo##T(const T* obj) { \ |
| 256 | return Vk##T(reinterpret_cast<uintptr_t>(obj)); \ |
| 257 | } |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 258 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 259 | // ----------------------------------------------------------------------------- |
| 260 | // Global |
| 261 | |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 262 | VKAPI_ATTR |
Daniel Koch | 09f7bf9 | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 263 | VkResult EnumerateInstanceVersion(uint32_t* pApiVersion) { |
Trevor David Black | 628c41a | 2021-09-27 05:07:22 +0000 | [diff] [blame] | 264 | *pApiVersion = VK_API_VERSION_1_3; |
Daniel Koch | 09f7bf9 | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 265 | return VK_SUCCESS; |
| 266 | } |
| 267 | |
| 268 | VKAPI_ATTR |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 269 | VkResult EnumerateInstanceExtensionProperties( |
| 270 | const char* layer_name, |
| 271 | uint32_t* count, |
| 272 | VkExtensionProperties* properties) { |
| 273 | if (layer_name) { |
| 274 | ALOGW( |
| 275 | "Driver vkEnumerateInstanceExtensionProperties shouldn't be called " |
| 276 | "with a layer name ('%s')", |
| 277 | layer_name); |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | const VkExtensionProperties kExtensions[] = { |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 281 | {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION}}; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 282 | const uint32_t kExtensionsCount = |
| 283 | sizeof(kExtensions) / sizeof(kExtensions[0]); |
| 284 | |
| 285 | if (!properties || *count > kExtensionsCount) |
| 286 | *count = kExtensionsCount; |
| 287 | if (properties) |
| 288 | std::copy(kExtensions, kExtensions + *count, properties); |
| 289 | return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS; |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 290 | } |
| 291 | |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 292 | VKAPI_ATTR |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 293 | VkResult CreateInstance(const VkInstanceCreateInfo* create_info, |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 294 | const VkAllocationCallbacks* allocator, |
| 295 | VkInstance* out_instance) { |
Jesse Hall | d3b1450 | 2016-04-20 16:58:11 -0700 | [diff] [blame] | 296 | if (!allocator) |
| 297 | allocator = &kDefaultAllocCallbacks; |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 298 | |
| 299 | VkInstance_T* instance = |
| 300 | static_cast<VkInstance_T*>(allocator->pfnAllocation( |
| 301 | allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T), |
| 302 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE)); |
| 303 | if (!instance) |
| 304 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 305 | |
| 306 | instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 307 | instance->allocator = *allocator; |
| 308 | instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 309 | instance->next_callback_handle = 0; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 310 | |
| 311 | for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) { |
| 312 | if (strcmp(create_info->ppEnabledExtensionNames[i], |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 313 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) { |
| 314 | ALOGV("instance extension '%s' requested", |
| 315 | create_info->ppEnabledExtensionNames[i]); |
| 316 | } else if (strcmp(create_info->ppEnabledExtensionNames[i], |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 317 | VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { |
Jesse Hall | b147127 | 2016-01-17 21:36:58 -0800 | [diff] [blame] | 318 | ALOGV("instance extension '%s' requested", |
| 319 | create_info->ppEnabledExtensionNames[i]); |
| 320 | } else { |
| 321 | ALOGW("unsupported extension '%s' requested", |
| 322 | create_info->ppEnabledExtensionNames[i]); |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 323 | } |
| 324 | } |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 325 | |
| 326 | *out_instance = instance; |
| 327 | return VK_SUCCESS; |
| 328 | } |
| 329 | |
| 330 | VKAPI_ATTR |
| 331 | PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) { |
| 332 | return instance ? GetInstanceProcAddr(name) : GetGlobalProcAddr(name); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 333 | } |
| 334 | |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 335 | VKAPI_ATTR |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 336 | PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) { |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 337 | return GetInstanceProcAddr(name); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 338 | } |
| 339 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 340 | // ----------------------------------------------------------------------------- |
| 341 | // Instance |
| 342 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 343 | void DestroyInstance(VkInstance instance, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 344 | const VkAllocationCallbacks* /*allocator*/) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 345 | instance->allocator.pfnFree(instance->allocator.pUserData, instance); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 346 | } |
| 347 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 348 | // ----------------------------------------------------------------------------- |
| 349 | // PhysicalDevice |
| 350 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 351 | VkResult EnumeratePhysicalDevices(VkInstance instance, |
| 352 | uint32_t* physical_device_count, |
| 353 | VkPhysicalDevice* physical_devices) { |
Ian Elliott | 3fe21f6 | 2017-10-20 10:41:01 -0600 | [diff] [blame] | 354 | if (!physical_devices) |
| 355 | *physical_device_count = 1; |
| 356 | else if (*physical_device_count == 0) |
| 357 | return VK_INCOMPLETE; |
| 358 | else { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 359 | physical_devices[0] = &instance->physical_device; |
Ian Elliott | 3fe21f6 | 2017-10-20 10:41:01 -0600 | [diff] [blame] | 360 | *physical_device_count = 1; |
| 361 | } |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 362 | return VK_SUCCESS; |
| 363 | } |
| 364 | |
Jesse Hall | 57f7f8c | 2016-01-17 17:21:36 -0800 | [diff] [blame] | 365 | VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice /*gpu*/, |
| 366 | uint32_t* count, |
| 367 | VkLayerProperties* /*properties*/) { |
| 368 | ALOGW("Driver vkEnumerateDeviceLayerProperties shouldn't be called"); |
| 369 | *count = 0; |
| 370 | return VK_SUCCESS; |
| 371 | } |
| 372 | |
| 373 | VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice /*gpu*/, |
| 374 | const char* layer_name, |
| 375 | uint32_t* count, |
| 376 | VkExtensionProperties* properties) { |
| 377 | if (layer_name) { |
| 378 | ALOGW( |
| 379 | "Driver vkEnumerateDeviceExtensionProperties shouldn't be called " |
| 380 | "with a layer name ('%s')", |
| 381 | layer_name); |
| 382 | *count = 0; |
| 383 | return VK_SUCCESS; |
| 384 | } |
| 385 | |
| 386 | const VkExtensionProperties kExtensions[] = { |
| 387 | {VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME, |
| 388 | VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION}}; |
| 389 | const uint32_t kExtensionsCount = |
| 390 | sizeof(kExtensions) / sizeof(kExtensions[0]); |
| 391 | |
| 392 | if (!properties || *count > kExtensionsCount) |
| 393 | *count = kExtensionsCount; |
| 394 | if (properties) |
| 395 | std::copy(kExtensions, kExtensions + *count, properties); |
| 396 | return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS; |
| 397 | } |
| 398 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 399 | void GetPhysicalDeviceProperties(VkPhysicalDevice, |
| 400 | VkPhysicalDeviceProperties* properties) { |
Trevor David Black | b68a225 | 2021-08-23 16:37:18 +0000 | [diff] [blame] | 401 | properties->apiVersion = VK_MAKE_API_VERSION(0, 1, 2, VK_HEADER_VERSION); |
| 402 | properties->driverVersion = VK_MAKE_API_VERSION(0, 0, 0, 1); |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 403 | properties->vendorID = 0; |
| 404 | properties->deviceID = 0; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 405 | properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; |
| 406 | strcpy(properties->deviceName, "Android Vulkan Null Driver"); |
| 407 | memset(properties->pipelineCacheUUID, 0, |
| 408 | sizeof(properties->pipelineCacheUUID)); |
Jesse Hall | c34849e | 2016-02-09 22:35:04 -0800 | [diff] [blame] | 409 | properties->limits = VkPhysicalDeviceLimits{ |
| 410 | 4096, // maxImageDimension1D |
| 411 | 4096, // maxImageDimension2D |
| 412 | 256, // maxImageDimension3D |
| 413 | 4096, // maxImageDimensionCube |
| 414 | 256, // maxImageArrayLayers |
| 415 | 65536, // maxTexelBufferElements |
| 416 | 16384, // maxUniformBufferRange |
| 417 | 1 << 27, // maxStorageBufferRange |
| 418 | 128, // maxPushConstantsSize |
| 419 | 4096, // maxMemoryAllocationCount |
| 420 | 4000, // maxSamplerAllocationCount |
| 421 | 1, // bufferImageGranularity |
| 422 | 0, // sparseAddressSpaceSize |
| 423 | 4, // maxBoundDescriptorSets |
| 424 | 16, // maxPerStageDescriptorSamplers |
| 425 | 12, // maxPerStageDescriptorUniformBuffers |
| 426 | 4, // maxPerStageDescriptorStorageBuffers |
| 427 | 16, // maxPerStageDescriptorSampledImages |
| 428 | 4, // maxPerStageDescriptorStorageImages |
| 429 | 4, // maxPerStageDescriptorInputAttachments |
| 430 | 128, // maxPerStageResources |
| 431 | 96, // maxDescriptorSetSamplers |
| 432 | 72, // maxDescriptorSetUniformBuffers |
| 433 | 8, // maxDescriptorSetUniformBuffersDynamic |
| 434 | 24, // maxDescriptorSetStorageBuffers |
| 435 | 4, // maxDescriptorSetStorageBuffersDynamic |
| 436 | 96, // maxDescriptorSetSampledImages |
| 437 | 24, // maxDescriptorSetStorageImages |
| 438 | 4, // maxDescriptorSetInputAttachments |
| 439 | 16, // maxVertexInputAttributes |
| 440 | 16, // maxVertexInputBindings |
| 441 | 2047, // maxVertexInputAttributeOffset |
| 442 | 2048, // maxVertexInputBindingStride |
| 443 | 64, // maxVertexOutputComponents |
| 444 | 0, // maxTessellationGenerationLevel |
| 445 | 0, // maxTessellationPatchSize |
| 446 | 0, // maxTessellationControlPerVertexInputComponents |
| 447 | 0, // maxTessellationControlPerVertexOutputComponents |
| 448 | 0, // maxTessellationControlPerPatchOutputComponents |
| 449 | 0, // maxTessellationControlTotalOutputComponents |
| 450 | 0, // maxTessellationEvaluationInputComponents |
| 451 | 0, // maxTessellationEvaluationOutputComponents |
| 452 | 0, // maxGeometryShaderInvocations |
| 453 | 0, // maxGeometryInputComponents |
| 454 | 0, // maxGeometryOutputComponents |
| 455 | 0, // maxGeometryOutputVertices |
| 456 | 0, // maxGeometryTotalOutputComponents |
| 457 | 64, // maxFragmentInputComponents |
| 458 | 4, // maxFragmentOutputAttachments |
| 459 | 0, // maxFragmentDualSrcAttachments |
| 460 | 4, // maxFragmentCombinedOutputResources |
| 461 | 16384, // maxComputeSharedMemorySize |
| 462 | {65536, 65536, 65536}, // maxComputeWorkGroupCount[3] |
| 463 | 128, // maxComputeWorkGroupInvocations |
| 464 | {128, 128, 64}, // maxComputeWorkGroupSize[3] |
| 465 | 4, // subPixelPrecisionBits |
| 466 | 4, // subTexelPrecisionBits |
| 467 | 4, // mipmapPrecisionBits |
| 468 | UINT32_MAX, // maxDrawIndexedIndexValue |
| 469 | 1, // maxDrawIndirectCount |
| 470 | 2, // maxSamplerLodBias |
| 471 | 1, // maxSamplerAnisotropy |
| 472 | 1, // maxViewports |
| 473 | {4096, 4096}, // maxViewportDimensions[2] |
| 474 | {-8192.0f, 8191.0f}, // viewportBoundsRange[2] |
| 475 | 0, // viewportSubPixelBits |
| 476 | 64, // minMemoryMapAlignment |
| 477 | 256, // minTexelBufferOffsetAlignment |
| 478 | 256, // minUniformBufferOffsetAlignment |
| 479 | 256, // minStorageBufferOffsetAlignment |
| 480 | -8, // minTexelOffset |
| 481 | 7, // maxTexelOffset |
| 482 | 0, // minTexelGatherOffset |
| 483 | 0, // maxTexelGatherOffset |
| 484 | 0.0f, // minInterpolationOffset |
| 485 | 0.0f, // maxInterpolationOffset |
| 486 | 0, // subPixelInterpolationOffsetBits |
| 487 | 4096, // maxFramebufferWidth |
| 488 | 4096, // maxFramebufferHeight |
| 489 | 256, // maxFramebufferLayers |
| 490 | VK_SAMPLE_COUNT_1_BIT | |
| 491 | VK_SAMPLE_COUNT_4_BIT, // framebufferColorSampleCounts |
| 492 | VK_SAMPLE_COUNT_1_BIT | |
| 493 | VK_SAMPLE_COUNT_4_BIT, // framebufferDepthSampleCounts |
| 494 | VK_SAMPLE_COUNT_1_BIT | |
| 495 | VK_SAMPLE_COUNT_4_BIT, // framebufferStencilSampleCounts |
| 496 | VK_SAMPLE_COUNT_1_BIT | |
| 497 | VK_SAMPLE_COUNT_4_BIT, // framebufferNoAttachmentsSampleCounts |
| 498 | 4, // maxColorAttachments |
| 499 | VK_SAMPLE_COUNT_1_BIT | |
| 500 | VK_SAMPLE_COUNT_4_BIT, // sampledImageColorSampleCounts |
| 501 | VK_SAMPLE_COUNT_1_BIT, // sampledImageIntegerSampleCounts |
| 502 | VK_SAMPLE_COUNT_1_BIT | |
| 503 | VK_SAMPLE_COUNT_4_BIT, // sampledImageDepthSampleCounts |
| 504 | VK_SAMPLE_COUNT_1_BIT | |
| 505 | VK_SAMPLE_COUNT_4_BIT, // sampledImageStencilSampleCounts |
| 506 | VK_SAMPLE_COUNT_1_BIT, // storageImageSampleCounts |
| 507 | 1, // maxSampleMaskWords |
| 508 | VK_TRUE, // timestampComputeAndGraphics |
| 509 | 1, // timestampPeriod |
| 510 | 0, // maxClipDistances |
| 511 | 0, // maxCullDistances |
| 512 | 0, // maxCombinedClipAndCullDistances |
| 513 | 2, // discreteQueuePriorities |
| 514 | {1.0f, 1.0f}, // pointSizeRange[2] |
| 515 | {1.0f, 1.0f}, // lineWidthRange[2] |
| 516 | 0.0f, // pointSizeGranularity |
| 517 | 0.0f, // lineWidthGranularity |
| 518 | VK_TRUE, // strictLines |
| 519 | VK_TRUE, // standardSampleLocations |
| 520 | 1, // optimalBufferCopyOffsetAlignment |
| 521 | 1, // optimalBufferCopyRowPitchAlignment |
| 522 | 64, // nonCoherentAtomSize |
| 523 | }; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 524 | } |
| 525 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 526 | void GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physical_device, |
| 527 | VkPhysicalDeviceProperties2KHR* properties) { |
| 528 | GetPhysicalDeviceProperties(physical_device, &properties->properties); |
Chris Forbes | b4eb278 | 2017-03-15 16:09:15 +1300 | [diff] [blame] | 529 | |
| 530 | while (properties->pNext) { |
| 531 | properties = reinterpret_cast<VkPhysicalDeviceProperties2KHR *>(properties->pNext); |
| 532 | |
| 533 | #pragma clang diagnostic push |
| 534 | #pragma clang diagnostic ignored "-Wold-style-cast" |
| 535 | switch ((VkFlags)properties->sType) { |
| 536 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID: { |
| 537 | VkPhysicalDevicePresentationPropertiesANDROID *presentation_properties = |
| 538 | reinterpret_cast<VkPhysicalDevicePresentationPropertiesANDROID *>(properties); |
| 539 | #pragma clang diagnostic pop |
| 540 | |
| 541 | // Claim that we do all the right things for the loader to |
| 542 | // expose KHR_shared_presentable_image on our behalf. |
| 543 | presentation_properties->sharedImage = VK_TRUE; |
| 544 | } break; |
| 545 | |
| 546 | default: |
| 547 | // Silently ignore other extension query structs |
| 548 | break; |
| 549 | } |
| 550 | } |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 551 | } |
| 552 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 553 | void GetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 554 | VkPhysicalDevice, |
| 555 | uint32_t* count, |
| 556 | VkQueueFamilyProperties* properties) { |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 557 | if (!properties || *count > 1) |
| 558 | *count = 1; |
| 559 | if (properties && *count == 1) { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 560 | properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | |
| 561 | VK_QUEUE_TRANSFER_BIT; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 562 | properties->queueCount = 1; |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 563 | properties->timestampValidBits = 64; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 564 | properties->minImageTransferGranularity = VkExtent3D{1, 1, 1}; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 565 | } |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 566 | } |
| 567 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 568 | void GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physical_device, uint32_t* count, VkQueueFamilyProperties2KHR* properties) { |
| 569 | // note: even though multiple structures, this is safe to forward in this |
| 570 | // case since we only expose one queue family. |
| 571 | GetPhysicalDeviceQueueFamilyProperties(physical_device, count, properties ? &properties->queueFamilyProperties : nullptr); |
| 572 | } |
| 573 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 574 | void GetPhysicalDeviceMemoryProperties( |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 575 | VkPhysicalDevice, |
| 576 | VkPhysicalDeviceMemoryProperties* properties) { |
| 577 | properties->memoryTypeCount = 1; |
| 578 | properties->memoryTypes[0].propertyFlags = |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 579 | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | |
| 580 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 581 | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | |
| 582 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 583 | properties->memoryTypes[0].heapIndex = 0; |
| 584 | properties->memoryHeapCount = 1; |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 585 | properties->memoryHeaps[0].size = kMaxDeviceMemory; |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 586 | properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 587 | } |
| 588 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 589 | void GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physical_device, VkPhysicalDeviceMemoryProperties2KHR* properties) { |
| 590 | GetPhysicalDeviceMemoryProperties(physical_device, &properties->memoryProperties); |
| 591 | } |
| 592 | |
Jesse Hall | 8e37cf3 | 2016-01-18 04:00:57 -0800 | [diff] [blame] | 593 | void GetPhysicalDeviceFeatures(VkPhysicalDevice /*gpu*/, |
| 594 | VkPhysicalDeviceFeatures* features) { |
| 595 | *features = VkPhysicalDeviceFeatures{ |
| 596 | VK_TRUE, // robustBufferAccess |
| 597 | VK_FALSE, // fullDrawIndexUint32 |
| 598 | VK_FALSE, // imageCubeArray |
| 599 | VK_FALSE, // independentBlend |
| 600 | VK_FALSE, // geometryShader |
| 601 | VK_FALSE, // tessellationShader |
| 602 | VK_FALSE, // sampleRateShading |
| 603 | VK_FALSE, // dualSrcBlend |
| 604 | VK_FALSE, // logicOp |
| 605 | VK_FALSE, // multiDrawIndirect |
| 606 | VK_FALSE, // drawIndirectFirstInstance |
| 607 | VK_FALSE, // depthClamp |
| 608 | VK_FALSE, // depthBiasClamp |
| 609 | VK_FALSE, // fillModeNonSolid |
| 610 | VK_FALSE, // depthBounds |
| 611 | VK_FALSE, // wideLines |
| 612 | VK_FALSE, // largePoints |
| 613 | VK_FALSE, // alphaToOne |
| 614 | VK_FALSE, // multiViewport |
| 615 | VK_FALSE, // samplerAnisotropy |
| 616 | VK_FALSE, // textureCompressionETC2 |
| 617 | VK_FALSE, // textureCompressionASTC_LDR |
| 618 | VK_FALSE, // textureCompressionBC |
| 619 | VK_FALSE, // occlusionQueryPrecise |
| 620 | VK_FALSE, // pipelineStatisticsQuery |
| 621 | VK_FALSE, // vertexPipelineStoresAndAtomics |
| 622 | VK_FALSE, // fragmentStoresAndAtomics |
| 623 | VK_FALSE, // shaderTessellationAndGeometryPointSize |
| 624 | VK_FALSE, // shaderImageGatherExtended |
| 625 | VK_FALSE, // shaderStorageImageExtendedFormats |
| 626 | VK_FALSE, // shaderStorageImageMultisample |
| 627 | VK_FALSE, // shaderStorageImageReadWithoutFormat |
| 628 | VK_FALSE, // shaderStorageImageWriteWithoutFormat |
| 629 | VK_FALSE, // shaderUniformBufferArrayDynamicIndexing |
| 630 | VK_FALSE, // shaderSampledImageArrayDynamicIndexing |
| 631 | VK_FALSE, // shaderStorageBufferArrayDynamicIndexing |
| 632 | VK_FALSE, // shaderStorageImageArrayDynamicIndexing |
| 633 | VK_FALSE, // shaderClipDistance |
| 634 | VK_FALSE, // shaderCullDistance |
| 635 | VK_FALSE, // shaderFloat64 |
| 636 | VK_FALSE, // shaderInt64 |
| 637 | VK_FALSE, // shaderInt16 |
| 638 | VK_FALSE, // shaderResourceResidency |
| 639 | VK_FALSE, // shaderResourceMinLod |
| 640 | VK_FALSE, // sparseBinding |
| 641 | VK_FALSE, // sparseResidencyBuffer |
| 642 | VK_FALSE, // sparseResidencyImage2D |
| 643 | VK_FALSE, // sparseResidencyImage3D |
| 644 | VK_FALSE, // sparseResidency2Samples |
| 645 | VK_FALSE, // sparseResidency4Samples |
| 646 | VK_FALSE, // sparseResidency8Samples |
| 647 | VK_FALSE, // sparseResidency16Samples |
| 648 | VK_FALSE, // sparseResidencyAliased |
| 649 | VK_FALSE, // variableMultisampleRate |
| 650 | VK_FALSE, // inheritedQueries |
| 651 | }; |
| 652 | } |
| 653 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 654 | void GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physical_device, VkPhysicalDeviceFeatures2KHR* features) { |
| 655 | GetPhysicalDeviceFeatures(physical_device, &features->features); |
| 656 | } |
| 657 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 658 | // ----------------------------------------------------------------------------- |
| 659 | // Device |
| 660 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 661 | VkResult CreateDevice(VkPhysicalDevice physical_device, |
Jesse Hall | b147127 | 2016-01-17 21:36:58 -0800 | [diff] [blame] | 662 | const VkDeviceCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 663 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 664 | VkDevice* out_device) { |
| 665 | VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 666 | if (!allocator) |
| 667 | allocator = &instance->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 668 | VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation( |
| 669 | allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T), |
| 670 | VK_SYSTEM_ALLOCATION_SCOPE_DEVICE)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 671 | if (!device) |
| 672 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 673 | |
| 674 | device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 675 | device->allocator = *allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 676 | device->instance = instance; |
| 677 | device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 678 | std::fill(device->next_handle.begin(), device->next_handle.end(), |
| 679 | UINT64_C(0)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 680 | |
Jesse Hall | b147127 | 2016-01-17 21:36:58 -0800 | [diff] [blame] | 681 | for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) { |
| 682 | if (strcmp(create_info->ppEnabledExtensionNames[i], |
| 683 | VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME) == 0) { |
| 684 | ALOGV("Enabling " VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME); |
| 685 | } |
| 686 | } |
| 687 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 688 | *out_device = device; |
| 689 | return VK_SUCCESS; |
| 690 | } |
| 691 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 692 | void DestroyDevice(VkDevice device, |
| 693 | const VkAllocationCallbacks* /*allocator*/) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 694 | if (!device) |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 695 | return; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 696 | device->allocator.pfnFree(device->allocator.pUserData, device); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 697 | } |
| 698 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 699 | void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 700 | *queue = &device->queue; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 701 | } |
| 702 | |
| 703 | // ----------------------------------------------------------------------------- |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 704 | // CommandPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 705 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 706 | struct CommandPool { |
| 707 | typedef VkCommandPool HandleType; |
| 708 | VkAllocationCallbacks allocator; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 709 | }; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 710 | DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 711 | |
| 712 | VkResult CreateCommandPool(VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 713 | const VkCommandPoolCreateInfo* /*create_info*/, |
| 714 | const VkAllocationCallbacks* allocator, |
| 715 | VkCommandPool* cmd_pool) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 716 | if (!allocator) |
| 717 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 718 | CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation( |
| 719 | allocator->pUserData, sizeof(CommandPool), alignof(CommandPool), |
| 720 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 721 | if (!pool) |
| 722 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 723 | pool->allocator = *allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 724 | *cmd_pool = GetHandleToCommandPool(pool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 725 | return VK_SUCCESS; |
| 726 | } |
| 727 | |
| 728 | void DestroyCommandPool(VkDevice /*device*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 729 | VkCommandPool cmd_pool, |
| 730 | const VkAllocationCallbacks* /*allocator*/) { |
| 731 | CommandPool* pool = GetCommandPoolFromHandle(cmd_pool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 732 | pool->allocator.pfnFree(pool->allocator.pUserData, pool); |
| 733 | } |
| 734 | |
| 735 | // ----------------------------------------------------------------------------- |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 736 | // CmdBuffer |
| 737 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 738 | VkResult AllocateCommandBuffers(VkDevice /*device*/, |
| 739 | const VkCommandBufferAllocateInfo* alloc_info, |
| 740 | VkCommandBuffer* cmdbufs) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 741 | VkResult result = VK_SUCCESS; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 742 | CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool); |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 743 | std::fill(cmdbufs, cmdbufs + alloc_info->commandBufferCount, nullptr); |
| 744 | for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 745 | cmdbufs[i] = |
| 746 | static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation( |
| 747 | pool.allocator.pUserData, sizeof(VkCommandBuffer_T), |
| 748 | alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 749 | if (!cmdbufs[i]) { |
| 750 | result = VK_ERROR_OUT_OF_HOST_MEMORY; |
| 751 | break; |
| 752 | } |
| 753 | cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 754 | } |
| 755 | if (result != VK_SUCCESS) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 756 | for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 757 | if (!cmdbufs[i]) |
| 758 | break; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 759 | pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 760 | } |
| 761 | } |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 762 | return result; |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 763 | } |
| 764 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 765 | void FreeCommandBuffers(VkDevice /*device*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 766 | VkCommandPool cmd_pool, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 767 | uint32_t count, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 768 | const VkCommandBuffer* cmdbufs) { |
| 769 | CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 770 | for (uint32_t i = 0; i < count; i++) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 771 | pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]); |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 772 | } |
| 773 | |
| 774 | // ----------------------------------------------------------------------------- |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 775 | // DeviceMemory |
| 776 | |
| 777 | struct DeviceMemory { |
| 778 | typedef VkDeviceMemory HandleType; |
| 779 | VkDeviceSize size; |
| 780 | alignas(16) uint8_t data[0]; |
| 781 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 782 | DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory) |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 783 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 784 | VkResult AllocateMemory(VkDevice device, |
| 785 | const VkMemoryAllocateInfo* alloc_info, |
| 786 | const VkAllocationCallbacks* allocator, |
| 787 | VkDeviceMemory* mem_handle) { |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 788 | if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize) |
| 789 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 790 | if (!allocator) |
| 791 | allocator = &device->allocator; |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 792 | |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 793 | size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize); |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 794 | DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation( |
| 795 | allocator->pUserData, size, alignof(DeviceMemory), |
| 796 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 797 | if (!mem) |
| 798 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 799 | mem->size = size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 800 | *mem_handle = GetHandleToDeviceMemory(mem); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 801 | return VK_SUCCESS; |
| 802 | } |
| 803 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 804 | void FreeMemory(VkDevice device, |
| 805 | VkDeviceMemory mem_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 806 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 807 | if (!allocator) |
| 808 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 809 | DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 810 | allocator->pfnFree(allocator->pUserData, mem); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 811 | } |
| 812 | |
| 813 | VkResult MapMemory(VkDevice, |
| 814 | VkDeviceMemory mem_handle, |
| 815 | VkDeviceSize offset, |
| 816 | VkDeviceSize, |
| 817 | VkMemoryMapFlags, |
| 818 | void** out_ptr) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 819 | DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 820 | *out_ptr = &mem->data[0] + offset; |
| 821 | return VK_SUCCESS; |
| 822 | } |
| 823 | |
| 824 | // ----------------------------------------------------------------------------- |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 825 | // Buffer |
| 826 | |
| 827 | struct Buffer { |
| 828 | typedef VkBuffer HandleType; |
| 829 | VkDeviceSize size; |
| 830 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 831 | DEFINE_OBJECT_HANDLE_CONVERSION(Buffer) |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 832 | |
| 833 | VkResult CreateBuffer(VkDevice device, |
| 834 | const VkBufferCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 835 | const VkAllocationCallbacks* allocator, |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 836 | VkBuffer* buffer_handle) { |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 837 | ALOGW_IF(create_info->size > kMaxDeviceMemory, |
| 838 | "CreateBuffer: requested size 0x%" PRIx64 |
| 839 | " exceeds max device memory size 0x%" PRIx64, |
| 840 | create_info->size, kMaxDeviceMemory); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 841 | if (!allocator) |
| 842 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 843 | Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation( |
| 844 | allocator->pUserData, sizeof(Buffer), alignof(Buffer), |
| 845 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 846 | if (!buffer) |
| 847 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 848 | buffer->size = create_info->size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 849 | *buffer_handle = GetHandleToBuffer(buffer); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 850 | return VK_SUCCESS; |
| 851 | } |
| 852 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 853 | void GetBufferMemoryRequirements(VkDevice, |
| 854 | VkBuffer buffer_handle, |
| 855 | VkMemoryRequirements* requirements) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 856 | Buffer* buffer = GetBufferFromHandle(buffer_handle); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 857 | requirements->size = buffer->size; |
| 858 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 859 | requirements->memoryTypeBits = 0x1; |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 860 | } |
| 861 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 862 | void DestroyBuffer(VkDevice device, |
| 863 | VkBuffer buffer_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 864 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 865 | if (!allocator) |
| 866 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 867 | Buffer* buffer = GetBufferFromHandle(buffer_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 868 | allocator->pfnFree(allocator->pUserData, buffer); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 869 | } |
| 870 | |
| 871 | // ----------------------------------------------------------------------------- |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 872 | // Image |
| 873 | |
| 874 | struct Image { |
| 875 | typedef VkImage HandleType; |
| 876 | VkDeviceSize size; |
| 877 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 878 | DEFINE_OBJECT_HANDLE_CONVERSION(Image) |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 879 | |
| 880 | VkResult CreateImage(VkDevice device, |
| 881 | const VkImageCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 882 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 883 | VkImage* image_handle) { |
| 884 | if (create_info->imageType != VK_IMAGE_TYPE_2D || |
| 885 | create_info->format != VK_FORMAT_R8G8B8A8_UNORM || |
| 886 | create_info->mipLevels != 1) { |
| 887 | ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u", |
| 888 | create_info->imageType, create_info->format, |
| 889 | create_info->mipLevels); |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 890 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 891 | } |
| 892 | |
| 893 | VkDeviceSize size = |
| 894 | VkDeviceSize(create_info->extent.width * create_info->extent.height) * |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 895 | create_info->arrayLayers * create_info->samples * 4u; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 896 | ALOGW_IF(size > kMaxDeviceMemory, |
| 897 | "CreateImage: image size 0x%" PRIx64 |
| 898 | " exceeds max device memory size 0x%" PRIx64, |
| 899 | size, kMaxDeviceMemory); |
| 900 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 901 | if (!allocator) |
| 902 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 903 | Image* image = static_cast<Image*>(allocator->pfnAllocation( |
| 904 | allocator->pUserData, sizeof(Image), alignof(Image), |
| 905 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 906 | if (!image) |
| 907 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 908 | image->size = size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 909 | *image_handle = GetHandleToImage(image); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 910 | return VK_SUCCESS; |
| 911 | } |
| 912 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 913 | void GetImageMemoryRequirements(VkDevice, |
| 914 | VkImage image_handle, |
| 915 | VkMemoryRequirements* requirements) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 916 | Image* image = GetImageFromHandle(image_handle); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 917 | requirements->size = image->size; |
| 918 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 919 | requirements->memoryTypeBits = 0x1; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 920 | } |
| 921 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 922 | void DestroyImage(VkDevice device, |
| 923 | VkImage image_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 924 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 925 | if (!allocator) |
| 926 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 927 | Image* image = GetImageFromHandle(image_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 928 | allocator->pfnFree(allocator->pUserData, image); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 929 | } |
| 930 | |
Jesse Hall | 57f7f8c | 2016-01-17 17:21:36 -0800 | [diff] [blame] | 931 | VkResult GetSwapchainGrallocUsageANDROID(VkDevice, |
| 932 | VkFormat, |
| 933 | VkImageUsageFlags, |
| 934 | int* grallocUsage) { |
| 935 | // The null driver never reads or writes the gralloc buffer |
| 936 | *grallocUsage = 0; |
| 937 | return VK_SUCCESS; |
| 938 | } |
| 939 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 940 | VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice, |
| 941 | VkFormat, |
| 942 | VkImageUsageFlags, |
| 943 | VkSwapchainImageUsageFlagsANDROID, |
Jesse Hall | d1abd74 | 2017-02-09 21:45:51 -0800 | [diff] [blame] | 944 | uint64_t* grallocConsumerUsage, |
| 945 | uint64_t* grallocProducerUsage) { |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 946 | // The null driver never reads or writes the gralloc buffer |
Jesse Hall | d1abd74 | 2017-02-09 21:45:51 -0800 | [diff] [blame] | 947 | *grallocConsumerUsage = 0; |
| 948 | *grallocProducerUsage = 0; |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 949 | return VK_SUCCESS; |
| 950 | } |
| 951 | |
Trevor David Black | 2cc4468 | 2022-03-09 00:31:38 +0000 | [diff] [blame] | 952 | VkResult GetSwapchainGrallocUsage3ANDROID( |
| 953 | VkDevice, |
| 954 | const VkGrallocUsageInfoANDROID* grallocUsageInfo, |
| 955 | uint64_t* grallocUsage) { |
| 956 | // The null driver never reads or writes the gralloc buffer |
| 957 | ALOGV("TODO: vk%s - grallocUsageInfo->format:%i", __FUNCTION__, |
| 958 | grallocUsageInfo->format); |
| 959 | *grallocUsage = 0; |
| 960 | return VK_SUCCESS; |
| 961 | } |
| 962 | |
Trevor David Black | b6ca842 | 2023-07-26 20:00:04 +0000 | [diff] [blame] | 963 | VkResult GetSwapchainGrallocUsage4ANDROID( |
| 964 | VkDevice, |
| 965 | const VkGrallocUsageInfo2ANDROID* grallocUsageInfo, |
| 966 | uint64_t* grallocUsage) { |
| 967 | // The null driver never reads or writes the gralloc buffer |
| 968 | ALOGV("TODO: vk%s - grallocUsageInfo->format:%i", __FUNCTION__, |
| 969 | grallocUsageInfo->format); |
| 970 | *grallocUsage = 0; |
| 971 | return VK_SUCCESS; |
| 972 | } |
| 973 | |
Jesse Hall | 57f7f8c | 2016-01-17 17:21:36 -0800 | [diff] [blame] | 974 | VkResult AcquireImageANDROID(VkDevice, |
| 975 | VkImage, |
| 976 | int fence, |
| 977 | VkSemaphore, |
| 978 | VkFence) { |
| 979 | close(fence); |
| 980 | return VK_SUCCESS; |
| 981 | } |
| 982 | |
| 983 | VkResult QueueSignalReleaseImageANDROID(VkQueue, |
| 984 | uint32_t, |
| 985 | const VkSemaphore*, |
| 986 | VkImage, |
| 987 | int* fence) { |
| 988 | *fence = -1; |
| 989 | return VK_SUCCESS; |
| 990 | } |
| 991 | |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 992 | // ----------------------------------------------------------------------------- |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 993 | // No-op types |
| 994 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 995 | VkResult CreateBufferView(VkDevice device, |
| 996 | const VkBufferViewCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 997 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 998 | VkBufferView* view) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 999 | *view = AllocHandle<VkBufferView>(device, HandleType::kBufferView); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1000 | return VK_SUCCESS; |
| 1001 | } |
| 1002 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1003 | VkResult CreateDescriptorPool(VkDevice device, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1004 | const VkDescriptorPoolCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1005 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1006 | VkDescriptorPool* pool) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1007 | *pool = AllocHandle<VkDescriptorPool>(device, HandleType::kDescriptorPool); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1008 | return VK_SUCCESS; |
| 1009 | } |
| 1010 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1011 | VkResult AllocateDescriptorSets(VkDevice device, |
| 1012 | const VkDescriptorSetAllocateInfo* alloc_info, |
| 1013 | VkDescriptorSet* descriptor_sets) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1014 | for (uint32_t i = 0; i < alloc_info->descriptorSetCount; i++) |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1015 | descriptor_sets[i] = |
| 1016 | AllocHandle<VkDescriptorSet>(device, HandleType::kDescriptorSet); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1017 | return VK_SUCCESS; |
| 1018 | } |
| 1019 | |
| 1020 | VkResult CreateDescriptorSetLayout(VkDevice device, |
| 1021 | const VkDescriptorSetLayoutCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1022 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1023 | VkDescriptorSetLayout* layout) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1024 | *layout = AllocHandle<VkDescriptorSetLayout>( |
| 1025 | device, HandleType::kDescriptorSetLayout); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1026 | return VK_SUCCESS; |
| 1027 | } |
| 1028 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1029 | VkResult CreateEvent(VkDevice device, |
| 1030 | const VkEventCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1031 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1032 | VkEvent* event) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1033 | *event = AllocHandle<VkEvent>(device, HandleType::kEvent); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1034 | return VK_SUCCESS; |
| 1035 | } |
| 1036 | |
| 1037 | VkResult CreateFence(VkDevice device, |
| 1038 | const VkFenceCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1039 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1040 | VkFence* fence) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1041 | *fence = AllocHandle<VkFence>(device, HandleType::kFence); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1042 | return VK_SUCCESS; |
| 1043 | } |
| 1044 | |
| 1045 | VkResult CreateFramebuffer(VkDevice device, |
| 1046 | const VkFramebufferCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1047 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1048 | VkFramebuffer* framebuffer) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1049 | *framebuffer = AllocHandle<VkFramebuffer>(device, HandleType::kFramebuffer); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1050 | return VK_SUCCESS; |
| 1051 | } |
| 1052 | |
| 1053 | VkResult CreateImageView(VkDevice device, |
| 1054 | const VkImageViewCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1055 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1056 | VkImageView* view) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1057 | *view = AllocHandle<VkImageView>(device, HandleType::kImageView); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1058 | return VK_SUCCESS; |
| 1059 | } |
| 1060 | |
| 1061 | VkResult CreateGraphicsPipelines(VkDevice device, |
| 1062 | VkPipelineCache, |
| 1063 | uint32_t count, |
| 1064 | const VkGraphicsPipelineCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1065 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1066 | VkPipeline* pipelines) { |
| 1067 | for (uint32_t i = 0; i < count; i++) |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1068 | pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1069 | return VK_SUCCESS; |
| 1070 | } |
| 1071 | |
| 1072 | VkResult CreateComputePipelines(VkDevice device, |
| 1073 | VkPipelineCache, |
| 1074 | uint32_t count, |
| 1075 | const VkComputePipelineCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1076 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1077 | VkPipeline* pipelines) { |
| 1078 | for (uint32_t i = 0; i < count; i++) |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1079 | pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1080 | return VK_SUCCESS; |
| 1081 | } |
| 1082 | |
| 1083 | VkResult CreatePipelineCache(VkDevice device, |
| 1084 | const VkPipelineCacheCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1085 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1086 | VkPipelineCache* cache) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1087 | *cache = AllocHandle<VkPipelineCache>(device, HandleType::kPipelineCache); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1088 | return VK_SUCCESS; |
| 1089 | } |
| 1090 | |
| 1091 | VkResult CreatePipelineLayout(VkDevice device, |
| 1092 | const VkPipelineLayoutCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1093 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1094 | VkPipelineLayout* layout) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1095 | *layout = |
| 1096 | AllocHandle<VkPipelineLayout>(device, HandleType::kPipelineLayout); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1097 | return VK_SUCCESS; |
| 1098 | } |
| 1099 | |
| 1100 | VkResult CreateQueryPool(VkDevice device, |
| 1101 | const VkQueryPoolCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1102 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1103 | VkQueryPool* pool) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1104 | *pool = AllocHandle<VkQueryPool>(device, HandleType::kQueryPool); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1105 | return VK_SUCCESS; |
| 1106 | } |
| 1107 | |
| 1108 | VkResult CreateRenderPass(VkDevice device, |
| 1109 | const VkRenderPassCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1110 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1111 | VkRenderPass* renderpass) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1112 | *renderpass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1113 | return VK_SUCCESS; |
| 1114 | } |
| 1115 | |
| 1116 | VkResult CreateSampler(VkDevice device, |
| 1117 | const VkSamplerCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1118 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1119 | VkSampler* sampler) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1120 | *sampler = AllocHandle<VkSampler>(device, HandleType::kSampler); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1121 | return VK_SUCCESS; |
| 1122 | } |
| 1123 | |
| 1124 | VkResult CreateSemaphore(VkDevice device, |
| 1125 | const VkSemaphoreCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1126 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1127 | VkSemaphore* semaphore) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1128 | *semaphore = AllocHandle<VkSemaphore>(device, HandleType::kSemaphore); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1129 | return VK_SUCCESS; |
| 1130 | } |
| 1131 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1132 | VkResult CreateShaderModule(VkDevice device, |
| 1133 | const VkShaderModuleCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1134 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1135 | VkShaderModule* module) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1136 | *module = AllocHandle<VkShaderModule>(device, HandleType::kShaderModule); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1137 | return VK_SUCCESS; |
| 1138 | } |
| 1139 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1140 | VkResult CreateDebugReportCallbackEXT(VkInstance instance, |
| 1141 | const VkDebugReportCallbackCreateInfoEXT*, |
| 1142 | const VkAllocationCallbacks*, |
| 1143 | VkDebugReportCallbackEXT* callback) { |
| 1144 | *callback = AllocHandle<VkDebugReportCallbackEXT>( |
| 1145 | instance, HandleType::kDebugReportCallbackEXT); |
| 1146 | return VK_SUCCESS; |
| 1147 | } |
| 1148 | |
Yiwei Zhang | 6be097b | 2020-10-19 20:22:05 -0700 | [diff] [blame] | 1149 | VkResult CreateRenderPass2(VkDevice device, |
| 1150 | const VkRenderPassCreateInfo2*, |
| 1151 | const VkAllocationCallbacks* /*allocator*/, |
| 1152 | VkRenderPass* pRenderPass) { |
| 1153 | *pRenderPass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass); |
| 1154 | return VK_SUCCESS; |
| 1155 | } |
| 1156 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1157 | // ----------------------------------------------------------------------------- |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1158 | // No-op entrypoints |
| 1159 | |
| 1160 | // clang-format off |
| 1161 | #pragma clang diagnostic push |
| 1162 | #pragma clang diagnostic ignored "-Wunused-parameter" |
| 1163 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1164 | void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1165 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1166 | } |
| 1167 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 1168 | void GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR* pFormatProperties) { |
| 1169 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1170 | } |
| 1171 | |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 1172 | VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1173 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 1174 | return VK_SUCCESS; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1175 | } |
| 1176 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 1177 | VkResult GetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, |
| 1178 | const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, |
| 1179 | VkImageFormatProperties2KHR* pImageFormatProperties) { |
| 1180 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1181 | return VK_SUCCESS; |
| 1182 | } |
| 1183 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1184 | VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1185 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1186 | return VK_SUCCESS; |
| 1187 | } |
| 1188 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1189 | VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1190 | return VK_SUCCESS; |
| 1191 | } |
| 1192 | |
| 1193 | VkResult QueueWaitIdle(VkQueue queue) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1194 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1195 | return VK_SUCCESS; |
| 1196 | } |
| 1197 | |
| 1198 | VkResult DeviceWaitIdle(VkDevice device) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1199 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1200 | return VK_SUCCESS; |
| 1201 | } |
| 1202 | |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 1203 | void UnmapMemory(VkDevice device, VkDeviceMemory mem) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1204 | } |
| 1205 | |
| 1206 | VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1207 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1208 | return VK_SUCCESS; |
| 1209 | } |
| 1210 | |
| 1211 | VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1212 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1213 | return VK_SUCCESS; |
| 1214 | } |
| 1215 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1216 | void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1217 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1218 | } |
| 1219 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1220 | VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 1221 | return VK_SUCCESS; |
| 1222 | } |
| 1223 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1224 | VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 1225 | return VK_SUCCESS; |
| 1226 | } |
| 1227 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1228 | void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1229 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1230 | } |
| 1231 | |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1232 | void GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1233 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1234 | } |
| 1235 | |
Chris Forbes | 86bdfbe | 2017-01-26 12:45:49 +1300 | [diff] [blame] | 1236 | void GetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, |
| 1237 | VkPhysicalDeviceSparseImageFormatInfo2KHR const* pInfo, |
| 1238 | unsigned int* pNumProperties, |
| 1239 | VkSparseImageFormatProperties2KHR* pProperties) { |
| 1240 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1241 | } |
| 1242 | |
| 1243 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1244 | VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1245 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1246 | return VK_SUCCESS; |
| 1247 | } |
| 1248 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1249 | void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1250 | } |
| 1251 | |
| 1252 | VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) { |
| 1253 | return VK_SUCCESS; |
| 1254 | } |
| 1255 | |
| 1256 | VkResult GetFenceStatus(VkDevice device, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1257 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1258 | return VK_SUCCESS; |
| 1259 | } |
| 1260 | |
| 1261 | VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) { |
| 1262 | return VK_SUCCESS; |
| 1263 | } |
| 1264 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1265 | void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1266 | } |
| 1267 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1268 | void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1269 | } |
| 1270 | |
| 1271 | VkResult GetEventStatus(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1272 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1273 | return VK_SUCCESS; |
| 1274 | } |
| 1275 | |
| 1276 | VkResult SetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1277 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1278 | return VK_SUCCESS; |
| 1279 | } |
| 1280 | |
| 1281 | VkResult ResetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1282 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1283 | return VK_SUCCESS; |
| 1284 | } |
| 1285 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1286 | void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1287 | } |
| 1288 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1289 | VkResult GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1290 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1291 | return VK_SUCCESS; |
| 1292 | } |
| 1293 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1294 | void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1295 | } |
| 1296 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1297 | void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1298 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1299 | } |
| 1300 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1301 | void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1302 | } |
| 1303 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1304 | void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1305 | } |
| 1306 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1307 | void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1308 | } |
| 1309 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1310 | VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1311 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1312 | return VK_SUCCESS; |
| 1313 | } |
| 1314 | |
| 1315 | VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1316 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1317 | return VK_SUCCESS; |
| 1318 | } |
| 1319 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1320 | void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1321 | } |
| 1322 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1323 | void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1324 | } |
| 1325 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1326 | void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1327 | } |
| 1328 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1329 | void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1330 | } |
| 1331 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1332 | void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1333 | } |
| 1334 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1335 | VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1336 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1337 | return VK_SUCCESS; |
| 1338 | } |
| 1339 | |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 1340 | void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1341 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1342 | } |
| 1343 | |
| 1344 | VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1345 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1346 | return VK_SUCCESS; |
| 1347 | } |
| 1348 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1349 | void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1350 | } |
| 1351 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1352 | void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1353 | } |
| 1354 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1355 | void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1356 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1357 | } |
| 1358 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1359 | VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1360 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1361 | return VK_SUCCESS; |
| 1362 | } |
| 1363 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1364 | VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1365 | return VK_SUCCESS; |
| 1366 | } |
| 1367 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1368 | VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1369 | return VK_SUCCESS; |
| 1370 | } |
| 1371 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1372 | VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1373 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1374 | return VK_SUCCESS; |
| 1375 | } |
| 1376 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1377 | void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1378 | } |
| 1379 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1380 | void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1381 | } |
| 1382 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1383 | void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1384 | } |
| 1385 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1386 | void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1387 | } |
| 1388 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1389 | void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1390 | } |
| 1391 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1392 | void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1393 | } |
| 1394 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1395 | void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1396 | } |
| 1397 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1398 | void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1399 | } |
| 1400 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1401 | void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1402 | } |
| 1403 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1404 | void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1405 | } |
| 1406 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1407 | void CmdBindDescriptorSets(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1408 | } |
| 1409 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1410 | void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1411 | } |
| 1412 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1413 | void CmdBindVertexBuffers(VkCommandBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1414 | } |
| 1415 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1416 | void CmdDraw(VkCommandBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1417 | } |
| 1418 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1419 | void CmdDrawIndexed(VkCommandBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1420 | } |
| 1421 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1422 | void CmdDrawIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1423 | } |
| 1424 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1425 | void CmdDrawIndexedIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1426 | } |
| 1427 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1428 | void CmdDispatch(VkCommandBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1429 | } |
| 1430 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1431 | void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1432 | } |
| 1433 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1434 | void CmdCopyBuffer(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1435 | } |
| 1436 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1437 | void CmdCopyImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1438 | } |
| 1439 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1440 | void CmdBlitImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1441 | } |
| 1442 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1443 | void CmdCopyBufferToImage(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1444 | } |
| 1445 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1446 | void CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1447 | } |
| 1448 | |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 1449 | void CmdUpdateBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const void* pData) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1450 | } |
| 1451 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1452 | void CmdFillBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1453 | } |
| 1454 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1455 | void CmdClearColorImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1456 | } |
| 1457 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1458 | void CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1459 | } |
| 1460 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1461 | void CmdClearAttachments(VkCommandBuffer cmdBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1462 | } |
| 1463 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1464 | void CmdResolveImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1465 | } |
| 1466 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1467 | void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1468 | } |
| 1469 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1470 | void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1471 | } |
| 1472 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1473 | void CmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1474 | } |
| 1475 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1476 | void CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1477 | } |
| 1478 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1479 | void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1480 | } |
| 1481 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1482 | void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1483 | } |
| 1484 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1485 | void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1486 | } |
| 1487 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1488 | void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1489 | } |
| 1490 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1491 | void CmdCopyQueryPoolResults(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1492 | } |
| 1493 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1494 | void CmdPushConstants(VkCommandBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1495 | } |
| 1496 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1497 | void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1498 | } |
| 1499 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1500 | void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1501 | } |
| 1502 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1503 | void CmdEndRenderPass(VkCommandBuffer cmdBuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1504 | } |
| 1505 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1506 | void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1507 | } |
| 1508 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1509 | void DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) { |
| 1510 | } |
| 1511 | |
| 1512 | void DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) { |
| 1513 | } |
| 1514 | |
Daniel Koch | 09f7bf9 | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 1515 | VkResult BindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) { |
| 1516 | return VK_SUCCESS; |
| 1517 | } |
| 1518 | |
| 1519 | VkResult BindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) { |
| 1520 | return VK_SUCCESS; |
| 1521 | } |
| 1522 | |
| 1523 | void GetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) { |
| 1524 | } |
| 1525 | |
| 1526 | void CmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) { |
| 1527 | } |
| 1528 | |
| 1529 | void CmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) { |
| 1530 | } |
| 1531 | |
| 1532 | VkResult EnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) { |
| 1533 | return VK_SUCCESS; |
| 1534 | } |
| 1535 | |
| 1536 | void GetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { |
| 1537 | } |
| 1538 | |
| 1539 | void GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { |
| 1540 | } |
| 1541 | |
| 1542 | void GetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { |
| 1543 | } |
| 1544 | |
| 1545 | void GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) { |
| 1546 | } |
| 1547 | |
| 1548 | void GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) { |
| 1549 | } |
| 1550 | |
| 1551 | void GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) { |
| 1552 | } |
| 1553 | |
| 1554 | VkResult GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) { |
| 1555 | return VK_SUCCESS; |
| 1556 | } |
| 1557 | |
| 1558 | void GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) { |
| 1559 | } |
| 1560 | |
| 1561 | void GetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) { |
| 1562 | } |
| 1563 | |
| 1564 | void GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) { |
| 1565 | } |
| 1566 | |
| 1567 | void TrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) { |
| 1568 | } |
| 1569 | |
| 1570 | void GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) { |
| 1571 | } |
| 1572 | |
| 1573 | VkResult CreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) { |
| 1574 | return VK_SUCCESS; |
| 1575 | } |
| 1576 | |
| 1577 | void DestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) { |
| 1578 | } |
| 1579 | |
| 1580 | VkResult CreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) { |
| 1581 | return VK_SUCCESS; |
| 1582 | } |
| 1583 | |
| 1584 | void DestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) { |
| 1585 | } |
| 1586 | |
| 1587 | void UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) { |
| 1588 | } |
| 1589 | |
| 1590 | void GetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) { |
| 1591 | } |
| 1592 | |
| 1593 | void GetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) { |
| 1594 | } |
| 1595 | |
| 1596 | void GetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) { |
| 1597 | } |
| 1598 | |
| 1599 | void GetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) { |
| 1600 | } |
| 1601 | |
Yiwei Zhang | 6be097b | 2020-10-19 20:22:05 -0700 | [diff] [blame] | 1602 | void ResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { |
| 1603 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1604 | } |
| 1605 | |
| 1606 | void CmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) { |
| 1607 | } |
| 1608 | |
| 1609 | void CmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) { |
| 1610 | } |
| 1611 | |
| 1612 | void CmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) { |
| 1613 | } |
| 1614 | |
| 1615 | VkResult GetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) { |
| 1616 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1617 | return VK_SUCCESS; |
| 1618 | } |
| 1619 | |
| 1620 | VkResult WaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) { |
| 1621 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1622 | return VK_SUCCESS; |
| 1623 | } |
| 1624 | |
| 1625 | VkResult SignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) { |
| 1626 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1627 | return VK_SUCCESS; |
| 1628 | } |
| 1629 | |
| 1630 | void CmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { |
| 1631 | } |
| 1632 | |
| 1633 | void CmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { |
| 1634 | } |
| 1635 | |
| 1636 | uint64_t GetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { |
| 1637 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1638 | return 0; |
| 1639 | } |
| 1640 | |
| 1641 | VkDeviceAddress GetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { |
| 1642 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1643 | return (VkDeviceAddress)0; |
| 1644 | } |
| 1645 | |
| 1646 | uint64_t GetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) { |
| 1647 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1648 | return 0; |
| 1649 | } |
| 1650 | |
Trevor David Black | 6e76a61 | 2022-01-24 22:28:40 +0000 | [diff] [blame] | 1651 | void CmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) { |
| 1652 | } |
| 1653 | |
| 1654 | void CmdEndRendering(VkCommandBuffer commandBuffer) { |
| 1655 | } |
| 1656 | |
| 1657 | void CmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) { |
| 1658 | } |
| 1659 | |
| 1660 | void CmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo) { |
| 1661 | } |
| 1662 | |
| 1663 | void CmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo) { |
| 1664 | } |
| 1665 | |
| 1666 | void CmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo) { |
| 1667 | } |
| 1668 | |
| 1669 | void CmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) { |
| 1670 | } |
| 1671 | |
| 1672 | void CmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) { |
| 1673 | } |
| 1674 | |
| 1675 | void CmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo) { |
| 1676 | } |
| 1677 | |
| 1678 | void CmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask) { |
| 1679 | } |
| 1680 | |
| 1681 | void CmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo) { |
| 1682 | } |
| 1683 | |
| 1684 | void CmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) { |
| 1685 | } |
| 1686 | |
| 1687 | void CmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) { |
| 1688 | } |
| 1689 | |
| 1690 | void CmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) { |
| 1691 | } |
| 1692 | |
| 1693 | void CmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) { |
| 1694 | } |
| 1695 | |
| 1696 | void CmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) { |
| 1697 | } |
| 1698 | |
| 1699 | void CmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) { |
| 1700 | } |
| 1701 | |
| 1702 | void CmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo* pDependencyInfo) { |
| 1703 | } |
| 1704 | |
| 1705 | void CmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace) { |
| 1706 | } |
| 1707 | |
| 1708 | void CmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) { |
| 1709 | } |
| 1710 | |
| 1711 | void CmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) { |
| 1712 | } |
| 1713 | |
| 1714 | void CmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) { |
| 1715 | } |
| 1716 | |
| 1717 | void CmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors) { |
| 1718 | } |
| 1719 | |
| 1720 | void CmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) { |
| 1721 | } |
| 1722 | |
| 1723 | void CmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) { |
| 1724 | } |
| 1725 | |
| 1726 | void CmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports) { |
| 1727 | } |
| 1728 | |
| 1729 | void CmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos) { |
| 1730 | } |
| 1731 | |
| 1732 | void CmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query) { |
| 1733 | } |
| 1734 | |
| 1735 | VkResult CreatePrivateDataSlot(VkDevice device, const VkPrivateDataSlotCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlot* pPrivateDataSlot) { |
| 1736 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1737 | return VK_SUCCESS; |
| 1738 | } |
| 1739 | |
| 1740 | void DestroyPrivateDataSlot(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks* pAllocator) { |
| 1741 | } |
| 1742 | |
| 1743 | void GetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) { |
| 1744 | } |
| 1745 | |
| 1746 | void GetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) { |
| 1747 | } |
| 1748 | |
| 1749 | void GetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { |
| 1750 | } |
| 1751 | |
| 1752 | VkResult GetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { |
| 1753 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1754 | return VK_SUCCESS; |
| 1755 | } |
| 1756 | |
| 1757 | void GetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t* pData) { |
| 1758 | } |
| 1759 | |
| 1760 | VkResult QueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence) { |
| 1761 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1762 | return VK_SUCCESS; |
| 1763 | } |
| 1764 | |
| 1765 | VkResult SetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data) { |
| 1766 | ALOGV("TODO: vk%s", __FUNCTION__); |
| 1767 | return VK_SUCCESS; |
| 1768 | } |
| 1769 | |
Chris Forbes | 500ce88 | 2024-10-08 17:47:31 +1300 | [diff] [blame] | 1770 | void GetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity) { |
| 1771 | } |
| 1772 | |
| 1773 | void CmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) { |
| 1774 | } |
| 1775 | |
| 1776 | void CmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) { |
| 1777 | } |
| 1778 | |
| 1779 | void CmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) { |
| 1780 | } |
| 1781 | |
| 1782 | void CmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) { |
| 1783 | } |
| 1784 | |
| 1785 | VkResult CopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) { |
| 1786 | return VK_SUCCESS; |
| 1787 | } |
| 1788 | |
| 1789 | VkResult CopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) { |
| 1790 | return VK_SUCCESS; |
| 1791 | } |
| 1792 | |
| 1793 | VkResult CopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo) { |
| 1794 | return VK_SUCCESS; |
| 1795 | } |
| 1796 | |
| 1797 | VkResult TransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo* pTransitions) { |
| 1798 | return VK_SUCCESS; |
| 1799 | } |
| 1800 | |
| 1801 | void GetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2* pSubresource, VkSubresourceLayout2* pLayout) { |
| 1802 | } |
| 1803 | |
| 1804 | void GetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo* pInfo, VkSubresourceLayout2* pLayout) { |
| 1805 | } |
| 1806 | |
| 1807 | VkResult MapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData) { |
| 1808 | return VK_SUCCESS; |
| 1809 | } |
| 1810 | |
| 1811 | VkResult UnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo) { |
| 1812 | return VK_SUCCESS; |
| 1813 | } |
| 1814 | |
| 1815 | void CmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) { |
| 1816 | } |
| 1817 | |
| 1818 | void CmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo) { |
| 1819 | } |
| 1820 | |
| 1821 | void CmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) { |
| 1822 | } |
| 1823 | |
| 1824 | void CmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) { |
| 1825 | } |
| 1826 | |
| 1827 | void CmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo) { |
| 1828 | } |
| 1829 | |
| 1830 | void CmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) { |
| 1831 | } |
| 1832 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1833 | #pragma clang diagnostic pop |
| 1834 | // clang-format on |
| 1835 | |
| 1836 | } // namespace null_driver |