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 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 17 | #include <hardware/hwvulkan.h> |
| 18 | |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 19 | #include <algorithm> |
| 20 | #include <array> |
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> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 24 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 25 | #include <log/log.h> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 26 | #include <utils/Errors.h> |
| 27 | |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 28 | #include "null_driver_gen.h" |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 29 | |
| 30 | using namespace null_driver; |
| 31 | |
| 32 | struct VkPhysicalDevice_T { |
| 33 | hwvulkan_dispatch_t dispatch; |
| 34 | }; |
| 35 | |
| 36 | struct VkInstance_T { |
| 37 | hwvulkan_dispatch_t dispatch; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 38 | VkAllocationCallbacks allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 39 | VkPhysicalDevice_T physical_device; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 40 | uint64_t next_callback_handle; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | struct VkQueue_T { |
| 44 | hwvulkan_dispatch_t dispatch; |
| 45 | }; |
| 46 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 47 | struct VkCommandBuffer_T { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 48 | hwvulkan_dispatch_t dispatch; |
| 49 | }; |
| 50 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 51 | namespace { |
| 52 | // Handles for non-dispatchable objects are either pointers, or arbitrary |
| 53 | // 64-bit non-zero values. We only use pointers when we need to keep state for |
| 54 | // the object even in a null driver. For the rest, we form a handle as: |
| 55 | // [63:63] = 1 to distinguish from pointer handles* |
| 56 | // [62:56] = non-zero handle type enum value |
| 57 | // [55: 0] = per-handle-type incrementing counter |
| 58 | // * This works because virtual addresses with the high bit set are reserved |
| 59 | // for kernel data in all ABIs we run on. |
| 60 | // |
| 61 | // We never reclaim handles on vkDestroy*. It's not even necessary for us to |
| 62 | // have distinct handles for live objects, and practically speaking we won't |
| 63 | // ever create 2^56 objects of the same type from a single VkDevice in a null |
| 64 | // driver. |
| 65 | // |
| 66 | // Using a namespace here instead of 'enum class' since we want scoped |
| 67 | // constants but also want implicit conversions to integral types. |
| 68 | namespace HandleType { |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 69 | enum Enum { |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 70 | kBufferView, |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 71 | kDebugReportCallbackEXT, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 72 | kDescriptorPool, |
| 73 | kDescriptorSet, |
| 74 | kDescriptorSetLayout, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 75 | kEvent, |
| 76 | kFence, |
| 77 | kFramebuffer, |
| 78 | kImageView, |
| 79 | kPipeline, |
| 80 | kPipelineCache, |
| 81 | kPipelineLayout, |
| 82 | kQueryPool, |
| 83 | kRenderPass, |
| 84 | kSampler, |
| 85 | kSemaphore, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 86 | kShaderModule, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 87 | |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 88 | kNumTypes |
| 89 | }; |
| 90 | } // namespace HandleType |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 91 | |
Jesse Hall | 00f10fe | 2016-02-08 21:20:20 -0800 | [diff] [blame] | 92 | const VkDeviceSize kMaxDeviceMemory = 0x10000000; // 256 MiB, arbitrary |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 93 | |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 94 | } // anonymous namespace |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 95 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 96 | struct VkDevice_T { |
| 97 | hwvulkan_dispatch_t dispatch; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 98 | VkAllocationCallbacks allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 99 | VkInstance_T* instance; |
| 100 | VkQueue_T queue; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 101 | std::array<uint64_t, HandleType::kNumTypes> next_handle; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 102 | }; |
| 103 | |
| 104 | // ----------------------------------------------------------------------------- |
| 105 | // Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device |
| 106 | // later. |
| 107 | |
| 108 | namespace { |
| 109 | int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device); |
| 110 | hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice}; |
| 111 | } // namespace |
| 112 | |
| 113 | #pragma clang diagnostic push |
| 114 | #pragma clang diagnostic ignored "-Wmissing-variable-declarations" |
| 115 | __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = { |
| 116 | .common = |
| 117 | { |
Michael Lentine | 03c64b0 | 2015-08-26 18:27:26 -0500 | [diff] [blame] | 118 | .tag = HARDWARE_MODULE_TAG, |
| 119 | .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1, |
| 120 | .hal_api_version = HARDWARE_HAL_API_VERSION, |
| 121 | .id = HWVULKAN_HARDWARE_MODULE_ID, |
| 122 | .name = "Null Vulkan Driver", |
| 123 | .author = "The Android Open Source Project", |
| 124 | .methods = &nulldrv_module_methods, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 125 | }, |
| 126 | }; |
| 127 | #pragma clang diagnostic pop |
| 128 | |
| 129 | // ----------------------------------------------------------------------------- |
| 130 | |
| 131 | namespace { |
| 132 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 133 | int CloseDevice(struct hw_device_t* /*device*/) { |
| 134 | // nothing to do - opening a device doesn't allocate any resources |
| 135 | return 0; |
| 136 | } |
| 137 | |
| 138 | hwvulkan_device_t nulldrv_device = { |
| 139 | .common = |
| 140 | { |
Michael Lentine | 03c64b0 | 2015-08-26 18:27:26 -0500 | [diff] [blame] | 141 | .tag = HARDWARE_DEVICE_TAG, |
| 142 | .version = HWVULKAN_DEVICE_API_VERSION_0_1, |
| 143 | .module = &HAL_MODULE_INFO_SYM.common, |
| 144 | .close = CloseDevice, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 145 | }, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 146 | .EnumerateInstanceExtensionProperties = |
| 147 | EnumerateInstanceExtensionProperties, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 148 | .CreateInstance = CreateInstance, |
| 149 | .GetInstanceProcAddr = GetInstanceProcAddr}; |
| 150 | |
| 151 | int OpenDevice(const hw_module_t* /*module*/, |
| 152 | const char* id, |
| 153 | hw_device_t** device) { |
| 154 | if (strcmp(id, HWVULKAN_DEVICE_0) == 0) { |
| 155 | *device = &nulldrv_device.common; |
| 156 | return 0; |
| 157 | } |
| 158 | return -ENOENT; |
| 159 | } |
| 160 | |
| 161 | VkInstance_T* GetInstanceFromPhysicalDevice( |
| 162 | VkPhysicalDevice_T* physical_device) { |
| 163 | return reinterpret_cast<VkInstance_T*>( |
| 164 | reinterpret_cast<uintptr_t>(physical_device) - |
| 165 | offsetof(VkInstance_T, physical_device)); |
| 166 | } |
| 167 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 168 | uint64_t AllocHandle(uint64_t type, uint64_t* next_handle) { |
| 169 | const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1; |
| 170 | ALOGE_IF(*next_handle == kHandleMask, |
| 171 | "non-dispatchable handles of type=%" PRIu64 |
| 172 | " are about to overflow", |
| 173 | type); |
| 174 | return (UINT64_C(1) << 63) | ((type & 0x7) << 56) | |
| 175 | ((*next_handle)++ & kHandleMask); |
| 176 | } |
| 177 | |
| 178 | template <class Handle> |
| 179 | Handle AllocHandle(VkInstance instance, HandleType::Enum type) { |
| 180 | return reinterpret_cast<Handle>( |
| 181 | AllocHandle(type, &instance->next_callback_handle)); |
| 182 | } |
| 183 | |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 184 | template <class Handle> |
| 185 | Handle AllocHandle(VkDevice device, HandleType::Enum type) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 186 | return reinterpret_cast<Handle>( |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 187 | AllocHandle(type, &device->next_handle[type])); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 188 | } |
| 189 | |
Jesse Hall | d3b1450 | 2016-04-20 16:58:11 -0700 | [diff] [blame] | 190 | VKAPI_ATTR void* DefaultAllocate(void*, |
| 191 | size_t size, |
| 192 | size_t alignment, |
| 193 | VkSystemAllocationScope) { |
| 194 | void* ptr = nullptr; |
| 195 | // Vulkan requires 'alignment' to be a power of two, but posix_memalign |
| 196 | // additionally requires that it be at least sizeof(void*). |
| 197 | int ret = posix_memalign(&ptr, std::max(alignment, sizeof(void*)), size); |
| 198 | return ret == 0 ? ptr : nullptr; |
| 199 | } |
| 200 | |
| 201 | VKAPI_ATTR void* DefaultReallocate(void*, |
| 202 | void* ptr, |
| 203 | size_t size, |
| 204 | size_t alignment, |
| 205 | VkSystemAllocationScope) { |
| 206 | if (size == 0) { |
| 207 | free(ptr); |
| 208 | return nullptr; |
| 209 | } |
| 210 | |
| 211 | // TODO(jessehall): Right now we never shrink allocations; if the new |
| 212 | // request is smaller than the existing chunk, we just continue using it. |
| 213 | // The null driver never reallocs, so this doesn't matter. If that changes, |
| 214 | // or if this code is copied into some other project, this should probably |
| 215 | // have a heuristic to allocate-copy-free when doing so will save "enough" |
| 216 | // space. |
| 217 | size_t old_size = ptr ? malloc_usable_size(ptr) : 0; |
| 218 | if (size <= old_size) |
| 219 | return ptr; |
| 220 | |
| 221 | void* new_ptr = nullptr; |
| 222 | if (posix_memalign(&new_ptr, std::max(alignment, sizeof(void*)), size) != 0) |
| 223 | return nullptr; |
| 224 | if (ptr) { |
| 225 | memcpy(new_ptr, ptr, std::min(old_size, size)); |
| 226 | free(ptr); |
| 227 | } |
| 228 | return new_ptr; |
| 229 | } |
| 230 | |
| 231 | VKAPI_ATTR void DefaultFree(void*, void* ptr) { |
| 232 | free(ptr); |
| 233 | } |
| 234 | |
| 235 | const VkAllocationCallbacks kDefaultAllocCallbacks = { |
| 236 | .pUserData = nullptr, |
| 237 | .pfnAllocation = DefaultAllocate, |
| 238 | .pfnReallocation = DefaultReallocate, |
| 239 | .pfnFree = DefaultFree, |
| 240 | }; |
| 241 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 242 | } // namespace |
| 243 | |
| 244 | namespace null_driver { |
| 245 | |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 246 | #define DEFINE_OBJECT_HANDLE_CONVERSION(T) \ |
| 247 | T* Get##T##FromHandle(Vk##T h); \ |
| 248 | T* Get##T##FromHandle(Vk##T h) { \ |
| 249 | return reinterpret_cast<T*>(uintptr_t(h)); \ |
| 250 | } \ |
| 251 | Vk##T GetHandleTo##T(const T* obj); \ |
| 252 | Vk##T GetHandleTo##T(const T* obj) { \ |
| 253 | return Vk##T(reinterpret_cast<uintptr_t>(obj)); \ |
| 254 | } |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 255 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 256 | // ----------------------------------------------------------------------------- |
| 257 | // Global |
| 258 | |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 259 | VKAPI_ATTR |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 260 | VkResult EnumerateInstanceExtensionProperties( |
| 261 | const char* layer_name, |
| 262 | uint32_t* count, |
| 263 | VkExtensionProperties* properties) { |
| 264 | if (layer_name) { |
| 265 | ALOGW( |
| 266 | "Driver vkEnumerateInstanceExtensionProperties shouldn't be called " |
| 267 | "with a layer name ('%s')", |
| 268 | layer_name); |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 269 | } |
| 270 | |
Jesse Hall | 4b62e4f | 2016-01-21 09:49:49 -0800 | [diff] [blame] | 271 | // NOTE: Change this to zero to report and extension, which can be useful |
| 272 | // for testing changes to the loader. |
| 273 | #if 1 |
| 274 | (void)properties; // unused |
| 275 | *count = 0; |
| 276 | return VK_SUCCESS; |
| 277 | #else |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 278 | const VkExtensionProperties kExtensions[] = { |
| 279 | {VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; |
| 280 | const uint32_t kExtensionsCount = |
| 281 | sizeof(kExtensions) / sizeof(kExtensions[0]); |
| 282 | |
| 283 | if (!properties || *count > kExtensionsCount) |
| 284 | *count = kExtensionsCount; |
| 285 | if (properties) |
| 286 | std::copy(kExtensions, kExtensions + *count, properties); |
| 287 | return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS; |
Jesse Hall | 4b62e4f | 2016-01-21 09:49:49 -0800 | [diff] [blame] | 288 | #endif |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 289 | } |
| 290 | |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 291 | VKAPI_ATTR |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 292 | VkResult CreateInstance(const VkInstanceCreateInfo* create_info, |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 293 | const VkAllocationCallbacks* allocator, |
| 294 | VkInstance* out_instance) { |
Jesse Hall | d3b1450 | 2016-04-20 16:58:11 -0700 | [diff] [blame] | 295 | if (!allocator) |
| 296 | allocator = &kDefaultAllocCallbacks; |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 297 | |
| 298 | VkInstance_T* instance = |
| 299 | static_cast<VkInstance_T*>(allocator->pfnAllocation( |
| 300 | allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T), |
| 301 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE)); |
| 302 | if (!instance) |
| 303 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 304 | |
| 305 | instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 306 | instance->allocator = *allocator; |
| 307 | instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 308 | instance->next_callback_handle = 0; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 309 | |
| 310 | for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) { |
| 311 | if (strcmp(create_info->ppEnabledExtensionNames[i], |
| 312 | VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { |
Jesse Hall | b147127 | 2016-01-17 21:36:58 -0800 | [diff] [blame] | 313 | ALOGV("instance extension '%s' requested", |
| 314 | create_info->ppEnabledExtensionNames[i]); |
| 315 | } else { |
| 316 | ALOGW("unsupported extension '%s' requested", |
| 317 | create_info->ppEnabledExtensionNames[i]); |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 318 | } |
| 319 | } |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 320 | |
| 321 | *out_instance = instance; |
| 322 | return VK_SUCCESS; |
| 323 | } |
| 324 | |
| 325 | VKAPI_ATTR |
| 326 | PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) { |
| 327 | return instance ? GetInstanceProcAddr(name) : GetGlobalProcAddr(name); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 328 | } |
| 329 | |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 330 | VKAPI_ATTR |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 331 | PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) { |
Jesse Hall | 1f91d39 | 2015-12-11 16:28:44 -0800 | [diff] [blame] | 332 | return GetInstanceProcAddr(name); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 333 | } |
| 334 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 335 | // ----------------------------------------------------------------------------- |
| 336 | // Instance |
| 337 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 338 | void DestroyInstance(VkInstance instance, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 339 | const VkAllocationCallbacks* /*allocator*/) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 340 | instance->allocator.pfnFree(instance->allocator.pUserData, instance); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 341 | } |
| 342 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 343 | // ----------------------------------------------------------------------------- |
| 344 | // PhysicalDevice |
| 345 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 346 | VkResult EnumeratePhysicalDevices(VkInstance instance, |
| 347 | uint32_t* physical_device_count, |
| 348 | VkPhysicalDevice* physical_devices) { |
| 349 | if (physical_devices && *physical_device_count >= 1) |
| 350 | physical_devices[0] = &instance->physical_device; |
| 351 | *physical_device_count = 1; |
| 352 | return VK_SUCCESS; |
| 353 | } |
| 354 | |
Jesse Hall | 57f7f8c | 2016-01-17 17:21:36 -0800 | [diff] [blame] | 355 | VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice /*gpu*/, |
| 356 | uint32_t* count, |
| 357 | VkLayerProperties* /*properties*/) { |
| 358 | ALOGW("Driver vkEnumerateDeviceLayerProperties shouldn't be called"); |
| 359 | *count = 0; |
| 360 | return VK_SUCCESS; |
| 361 | } |
| 362 | |
| 363 | VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice /*gpu*/, |
| 364 | const char* layer_name, |
| 365 | uint32_t* count, |
| 366 | VkExtensionProperties* properties) { |
| 367 | if (layer_name) { |
| 368 | ALOGW( |
| 369 | "Driver vkEnumerateDeviceExtensionProperties shouldn't be called " |
| 370 | "with a layer name ('%s')", |
| 371 | layer_name); |
| 372 | *count = 0; |
| 373 | return VK_SUCCESS; |
| 374 | } |
| 375 | |
| 376 | const VkExtensionProperties kExtensions[] = { |
| 377 | {VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME, |
| 378 | VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION}}; |
| 379 | const uint32_t kExtensionsCount = |
| 380 | sizeof(kExtensions) / sizeof(kExtensions[0]); |
| 381 | |
| 382 | if (!properties || *count > kExtensionsCount) |
| 383 | *count = kExtensionsCount; |
| 384 | if (properties) |
| 385 | std::copy(kExtensions, kExtensions + *count, properties); |
| 386 | return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS; |
| 387 | } |
| 388 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 389 | void GetPhysicalDeviceProperties(VkPhysicalDevice, |
| 390 | VkPhysicalDeviceProperties* properties) { |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 391 | properties->apiVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 392 | properties->driverVersion = VK_MAKE_VERSION(0, 0, 1); |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 393 | properties->vendorID = 0; |
| 394 | properties->deviceID = 0; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 395 | properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; |
| 396 | strcpy(properties->deviceName, "Android Vulkan Null Driver"); |
| 397 | memset(properties->pipelineCacheUUID, 0, |
| 398 | sizeof(properties->pipelineCacheUUID)); |
Jesse Hall | c34849e | 2016-02-09 22:35:04 -0800 | [diff] [blame] | 399 | properties->limits = VkPhysicalDeviceLimits{ |
| 400 | 4096, // maxImageDimension1D |
| 401 | 4096, // maxImageDimension2D |
| 402 | 256, // maxImageDimension3D |
| 403 | 4096, // maxImageDimensionCube |
| 404 | 256, // maxImageArrayLayers |
| 405 | 65536, // maxTexelBufferElements |
| 406 | 16384, // maxUniformBufferRange |
| 407 | 1 << 27, // maxStorageBufferRange |
| 408 | 128, // maxPushConstantsSize |
| 409 | 4096, // maxMemoryAllocationCount |
| 410 | 4000, // maxSamplerAllocationCount |
| 411 | 1, // bufferImageGranularity |
| 412 | 0, // sparseAddressSpaceSize |
| 413 | 4, // maxBoundDescriptorSets |
| 414 | 16, // maxPerStageDescriptorSamplers |
| 415 | 12, // maxPerStageDescriptorUniformBuffers |
| 416 | 4, // maxPerStageDescriptorStorageBuffers |
| 417 | 16, // maxPerStageDescriptorSampledImages |
| 418 | 4, // maxPerStageDescriptorStorageImages |
| 419 | 4, // maxPerStageDescriptorInputAttachments |
| 420 | 128, // maxPerStageResources |
| 421 | 96, // maxDescriptorSetSamplers |
| 422 | 72, // maxDescriptorSetUniformBuffers |
| 423 | 8, // maxDescriptorSetUniformBuffersDynamic |
| 424 | 24, // maxDescriptorSetStorageBuffers |
| 425 | 4, // maxDescriptorSetStorageBuffersDynamic |
| 426 | 96, // maxDescriptorSetSampledImages |
| 427 | 24, // maxDescriptorSetStorageImages |
| 428 | 4, // maxDescriptorSetInputAttachments |
| 429 | 16, // maxVertexInputAttributes |
| 430 | 16, // maxVertexInputBindings |
| 431 | 2047, // maxVertexInputAttributeOffset |
| 432 | 2048, // maxVertexInputBindingStride |
| 433 | 64, // maxVertexOutputComponents |
| 434 | 0, // maxTessellationGenerationLevel |
| 435 | 0, // maxTessellationPatchSize |
| 436 | 0, // maxTessellationControlPerVertexInputComponents |
| 437 | 0, // maxTessellationControlPerVertexOutputComponents |
| 438 | 0, // maxTessellationControlPerPatchOutputComponents |
| 439 | 0, // maxTessellationControlTotalOutputComponents |
| 440 | 0, // maxTessellationEvaluationInputComponents |
| 441 | 0, // maxTessellationEvaluationOutputComponents |
| 442 | 0, // maxGeometryShaderInvocations |
| 443 | 0, // maxGeometryInputComponents |
| 444 | 0, // maxGeometryOutputComponents |
| 445 | 0, // maxGeometryOutputVertices |
| 446 | 0, // maxGeometryTotalOutputComponents |
| 447 | 64, // maxFragmentInputComponents |
| 448 | 4, // maxFragmentOutputAttachments |
| 449 | 0, // maxFragmentDualSrcAttachments |
| 450 | 4, // maxFragmentCombinedOutputResources |
| 451 | 16384, // maxComputeSharedMemorySize |
| 452 | {65536, 65536, 65536}, // maxComputeWorkGroupCount[3] |
| 453 | 128, // maxComputeWorkGroupInvocations |
| 454 | {128, 128, 64}, // maxComputeWorkGroupSize[3] |
| 455 | 4, // subPixelPrecisionBits |
| 456 | 4, // subTexelPrecisionBits |
| 457 | 4, // mipmapPrecisionBits |
| 458 | UINT32_MAX, // maxDrawIndexedIndexValue |
| 459 | 1, // maxDrawIndirectCount |
| 460 | 2, // maxSamplerLodBias |
| 461 | 1, // maxSamplerAnisotropy |
| 462 | 1, // maxViewports |
| 463 | {4096, 4096}, // maxViewportDimensions[2] |
| 464 | {-8192.0f, 8191.0f}, // viewportBoundsRange[2] |
| 465 | 0, // viewportSubPixelBits |
| 466 | 64, // minMemoryMapAlignment |
| 467 | 256, // minTexelBufferOffsetAlignment |
| 468 | 256, // minUniformBufferOffsetAlignment |
| 469 | 256, // minStorageBufferOffsetAlignment |
| 470 | -8, // minTexelOffset |
| 471 | 7, // maxTexelOffset |
| 472 | 0, // minTexelGatherOffset |
| 473 | 0, // maxTexelGatherOffset |
| 474 | 0.0f, // minInterpolationOffset |
| 475 | 0.0f, // maxInterpolationOffset |
| 476 | 0, // subPixelInterpolationOffsetBits |
| 477 | 4096, // maxFramebufferWidth |
| 478 | 4096, // maxFramebufferHeight |
| 479 | 256, // maxFramebufferLayers |
| 480 | VK_SAMPLE_COUNT_1_BIT | |
| 481 | VK_SAMPLE_COUNT_4_BIT, // framebufferColorSampleCounts |
| 482 | VK_SAMPLE_COUNT_1_BIT | |
| 483 | VK_SAMPLE_COUNT_4_BIT, // framebufferDepthSampleCounts |
| 484 | VK_SAMPLE_COUNT_1_BIT | |
| 485 | VK_SAMPLE_COUNT_4_BIT, // framebufferStencilSampleCounts |
| 486 | VK_SAMPLE_COUNT_1_BIT | |
| 487 | VK_SAMPLE_COUNT_4_BIT, // framebufferNoAttachmentsSampleCounts |
| 488 | 4, // maxColorAttachments |
| 489 | VK_SAMPLE_COUNT_1_BIT | |
| 490 | VK_SAMPLE_COUNT_4_BIT, // sampledImageColorSampleCounts |
| 491 | VK_SAMPLE_COUNT_1_BIT, // sampledImageIntegerSampleCounts |
| 492 | VK_SAMPLE_COUNT_1_BIT | |
| 493 | VK_SAMPLE_COUNT_4_BIT, // sampledImageDepthSampleCounts |
| 494 | VK_SAMPLE_COUNT_1_BIT | |
| 495 | VK_SAMPLE_COUNT_4_BIT, // sampledImageStencilSampleCounts |
| 496 | VK_SAMPLE_COUNT_1_BIT, // storageImageSampleCounts |
| 497 | 1, // maxSampleMaskWords |
| 498 | VK_TRUE, // timestampComputeAndGraphics |
| 499 | 1, // timestampPeriod |
| 500 | 0, // maxClipDistances |
| 501 | 0, // maxCullDistances |
| 502 | 0, // maxCombinedClipAndCullDistances |
| 503 | 2, // discreteQueuePriorities |
| 504 | {1.0f, 1.0f}, // pointSizeRange[2] |
| 505 | {1.0f, 1.0f}, // lineWidthRange[2] |
| 506 | 0.0f, // pointSizeGranularity |
| 507 | 0.0f, // lineWidthGranularity |
| 508 | VK_TRUE, // strictLines |
| 509 | VK_TRUE, // standardSampleLocations |
| 510 | 1, // optimalBufferCopyOffsetAlignment |
| 511 | 1, // optimalBufferCopyRowPitchAlignment |
| 512 | 64, // nonCoherentAtomSize |
| 513 | }; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 514 | } |
| 515 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 516 | void GetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 517 | VkPhysicalDevice, |
| 518 | uint32_t* count, |
| 519 | VkQueueFamilyProperties* properties) { |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 520 | if (!properties || *count > 1) |
| 521 | *count = 1; |
| 522 | if (properties && *count == 1) { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 523 | properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | |
| 524 | VK_QUEUE_TRANSFER_BIT; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 525 | properties->queueCount = 1; |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 526 | properties->timestampValidBits = 64; |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 527 | properties->minImageTransferGranularity = VkExtent3D{1, 1, 1}; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 528 | } |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 529 | } |
| 530 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 531 | void GetPhysicalDeviceMemoryProperties( |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 532 | VkPhysicalDevice, |
| 533 | VkPhysicalDeviceMemoryProperties* properties) { |
| 534 | properties->memoryTypeCount = 1; |
| 535 | properties->memoryTypes[0].propertyFlags = |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 536 | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | |
| 537 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 538 | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | |
| 539 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 540 | properties->memoryTypes[0].heapIndex = 0; |
| 541 | properties->memoryHeapCount = 1; |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 542 | properties->memoryHeaps[0].size = kMaxDeviceMemory; |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 543 | properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 544 | } |
| 545 | |
Jesse Hall | 8e37cf3 | 2016-01-18 04:00:57 -0800 | [diff] [blame] | 546 | void GetPhysicalDeviceFeatures(VkPhysicalDevice /*gpu*/, |
| 547 | VkPhysicalDeviceFeatures* features) { |
| 548 | *features = VkPhysicalDeviceFeatures{ |
| 549 | VK_TRUE, // robustBufferAccess |
| 550 | VK_FALSE, // fullDrawIndexUint32 |
| 551 | VK_FALSE, // imageCubeArray |
| 552 | VK_FALSE, // independentBlend |
| 553 | VK_FALSE, // geometryShader |
| 554 | VK_FALSE, // tessellationShader |
| 555 | VK_FALSE, // sampleRateShading |
| 556 | VK_FALSE, // dualSrcBlend |
| 557 | VK_FALSE, // logicOp |
| 558 | VK_FALSE, // multiDrawIndirect |
| 559 | VK_FALSE, // drawIndirectFirstInstance |
| 560 | VK_FALSE, // depthClamp |
| 561 | VK_FALSE, // depthBiasClamp |
| 562 | VK_FALSE, // fillModeNonSolid |
| 563 | VK_FALSE, // depthBounds |
| 564 | VK_FALSE, // wideLines |
| 565 | VK_FALSE, // largePoints |
| 566 | VK_FALSE, // alphaToOne |
| 567 | VK_FALSE, // multiViewport |
| 568 | VK_FALSE, // samplerAnisotropy |
| 569 | VK_FALSE, // textureCompressionETC2 |
| 570 | VK_FALSE, // textureCompressionASTC_LDR |
| 571 | VK_FALSE, // textureCompressionBC |
| 572 | VK_FALSE, // occlusionQueryPrecise |
| 573 | VK_FALSE, // pipelineStatisticsQuery |
| 574 | VK_FALSE, // vertexPipelineStoresAndAtomics |
| 575 | VK_FALSE, // fragmentStoresAndAtomics |
| 576 | VK_FALSE, // shaderTessellationAndGeometryPointSize |
| 577 | VK_FALSE, // shaderImageGatherExtended |
| 578 | VK_FALSE, // shaderStorageImageExtendedFormats |
| 579 | VK_FALSE, // shaderStorageImageMultisample |
| 580 | VK_FALSE, // shaderStorageImageReadWithoutFormat |
| 581 | VK_FALSE, // shaderStorageImageWriteWithoutFormat |
| 582 | VK_FALSE, // shaderUniformBufferArrayDynamicIndexing |
| 583 | VK_FALSE, // shaderSampledImageArrayDynamicIndexing |
| 584 | VK_FALSE, // shaderStorageBufferArrayDynamicIndexing |
| 585 | VK_FALSE, // shaderStorageImageArrayDynamicIndexing |
| 586 | VK_FALSE, // shaderClipDistance |
| 587 | VK_FALSE, // shaderCullDistance |
| 588 | VK_FALSE, // shaderFloat64 |
| 589 | VK_FALSE, // shaderInt64 |
| 590 | VK_FALSE, // shaderInt16 |
| 591 | VK_FALSE, // shaderResourceResidency |
| 592 | VK_FALSE, // shaderResourceMinLod |
| 593 | VK_FALSE, // sparseBinding |
| 594 | VK_FALSE, // sparseResidencyBuffer |
| 595 | VK_FALSE, // sparseResidencyImage2D |
| 596 | VK_FALSE, // sparseResidencyImage3D |
| 597 | VK_FALSE, // sparseResidency2Samples |
| 598 | VK_FALSE, // sparseResidency4Samples |
| 599 | VK_FALSE, // sparseResidency8Samples |
| 600 | VK_FALSE, // sparseResidency16Samples |
| 601 | VK_FALSE, // sparseResidencyAliased |
| 602 | VK_FALSE, // variableMultisampleRate |
| 603 | VK_FALSE, // inheritedQueries |
| 604 | }; |
| 605 | } |
| 606 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 607 | // ----------------------------------------------------------------------------- |
| 608 | // Device |
| 609 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 610 | VkResult CreateDevice(VkPhysicalDevice physical_device, |
Jesse Hall | b147127 | 2016-01-17 21:36:58 -0800 | [diff] [blame] | 611 | const VkDeviceCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 612 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 613 | VkDevice* out_device) { |
| 614 | VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 615 | if (!allocator) |
| 616 | allocator = &instance->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 617 | VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation( |
| 618 | allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T), |
| 619 | VK_SYSTEM_ALLOCATION_SCOPE_DEVICE)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 620 | if (!device) |
| 621 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 622 | |
| 623 | device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 624 | device->allocator = *allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 625 | device->instance = instance; |
| 626 | device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 627 | std::fill(device->next_handle.begin(), device->next_handle.end(), |
| 628 | UINT64_C(0)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 629 | |
Jesse Hall | b147127 | 2016-01-17 21:36:58 -0800 | [diff] [blame] | 630 | for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) { |
| 631 | if (strcmp(create_info->ppEnabledExtensionNames[i], |
| 632 | VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME) == 0) { |
| 633 | ALOGV("Enabling " VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME); |
| 634 | } |
| 635 | } |
| 636 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 637 | *out_device = device; |
| 638 | return VK_SUCCESS; |
| 639 | } |
| 640 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 641 | void DestroyDevice(VkDevice device, |
| 642 | const VkAllocationCallbacks* /*allocator*/) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 643 | if (!device) |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 644 | return; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 645 | device->allocator.pfnFree(device->allocator.pUserData, device); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 646 | } |
| 647 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 648 | void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 649 | *queue = &device->queue; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 650 | } |
| 651 | |
| 652 | // ----------------------------------------------------------------------------- |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 653 | // CommandPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 654 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 655 | struct CommandPool { |
| 656 | typedef VkCommandPool HandleType; |
| 657 | VkAllocationCallbacks allocator; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 658 | }; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 659 | DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 660 | |
| 661 | VkResult CreateCommandPool(VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 662 | const VkCommandPoolCreateInfo* /*create_info*/, |
| 663 | const VkAllocationCallbacks* allocator, |
| 664 | VkCommandPool* cmd_pool) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 665 | if (!allocator) |
| 666 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 667 | CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation( |
| 668 | allocator->pUserData, sizeof(CommandPool), alignof(CommandPool), |
| 669 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 670 | if (!pool) |
| 671 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 672 | pool->allocator = *allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 673 | *cmd_pool = GetHandleToCommandPool(pool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 674 | return VK_SUCCESS; |
| 675 | } |
| 676 | |
| 677 | void DestroyCommandPool(VkDevice /*device*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 678 | VkCommandPool cmd_pool, |
| 679 | const VkAllocationCallbacks* /*allocator*/) { |
| 680 | CommandPool* pool = GetCommandPoolFromHandle(cmd_pool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 681 | pool->allocator.pfnFree(pool->allocator.pUserData, pool); |
| 682 | } |
| 683 | |
| 684 | // ----------------------------------------------------------------------------- |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 685 | // CmdBuffer |
| 686 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 687 | VkResult AllocateCommandBuffers(VkDevice /*device*/, |
| 688 | const VkCommandBufferAllocateInfo* alloc_info, |
| 689 | VkCommandBuffer* cmdbufs) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 690 | VkResult result = VK_SUCCESS; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 691 | CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool); |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 692 | std::fill(cmdbufs, cmdbufs + alloc_info->commandBufferCount, nullptr); |
| 693 | for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 694 | cmdbufs[i] = |
| 695 | static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation( |
| 696 | pool.allocator.pUserData, sizeof(VkCommandBuffer_T), |
| 697 | alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 698 | if (!cmdbufs[i]) { |
| 699 | result = VK_ERROR_OUT_OF_HOST_MEMORY; |
| 700 | break; |
| 701 | } |
| 702 | cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 703 | } |
| 704 | if (result != VK_SUCCESS) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 705 | for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 706 | if (!cmdbufs[i]) |
| 707 | break; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 708 | pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 709 | } |
| 710 | } |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 711 | return result; |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 712 | } |
| 713 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 714 | void FreeCommandBuffers(VkDevice /*device*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 715 | VkCommandPool cmd_pool, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 716 | uint32_t count, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 717 | const VkCommandBuffer* cmdbufs) { |
| 718 | CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 719 | for (uint32_t i = 0; i < count; i++) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 720 | pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]); |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 721 | } |
| 722 | |
| 723 | // ----------------------------------------------------------------------------- |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 724 | // DeviceMemory |
| 725 | |
| 726 | struct DeviceMemory { |
| 727 | typedef VkDeviceMemory HandleType; |
| 728 | VkDeviceSize size; |
| 729 | alignas(16) uint8_t data[0]; |
| 730 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 731 | DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory) |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 732 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 733 | VkResult AllocateMemory(VkDevice device, |
| 734 | const VkMemoryAllocateInfo* alloc_info, |
| 735 | const VkAllocationCallbacks* allocator, |
| 736 | VkDeviceMemory* mem_handle) { |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 737 | if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize) |
| 738 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 739 | if (!allocator) |
| 740 | allocator = &device->allocator; |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 741 | |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 742 | size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize); |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 743 | DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation( |
| 744 | allocator->pUserData, size, alignof(DeviceMemory), |
| 745 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 746 | if (!mem) |
| 747 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 748 | mem->size = size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 749 | *mem_handle = GetHandleToDeviceMemory(mem); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 750 | return VK_SUCCESS; |
| 751 | } |
| 752 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 753 | void FreeMemory(VkDevice device, |
| 754 | VkDeviceMemory mem_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 755 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 756 | if (!allocator) |
| 757 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 758 | DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 759 | allocator->pfnFree(allocator->pUserData, mem); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 760 | } |
| 761 | |
| 762 | VkResult MapMemory(VkDevice, |
| 763 | VkDeviceMemory mem_handle, |
| 764 | VkDeviceSize offset, |
| 765 | VkDeviceSize, |
| 766 | VkMemoryMapFlags, |
| 767 | void** out_ptr) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 768 | DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 769 | *out_ptr = &mem->data[0] + offset; |
| 770 | return VK_SUCCESS; |
| 771 | } |
| 772 | |
| 773 | // ----------------------------------------------------------------------------- |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 774 | // Buffer |
| 775 | |
| 776 | struct Buffer { |
| 777 | typedef VkBuffer HandleType; |
| 778 | VkDeviceSize size; |
| 779 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 780 | DEFINE_OBJECT_HANDLE_CONVERSION(Buffer) |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 781 | |
| 782 | VkResult CreateBuffer(VkDevice device, |
| 783 | const VkBufferCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 784 | const VkAllocationCallbacks* allocator, |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 785 | VkBuffer* buffer_handle) { |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 786 | ALOGW_IF(create_info->size > kMaxDeviceMemory, |
| 787 | "CreateBuffer: requested size 0x%" PRIx64 |
| 788 | " exceeds max device memory size 0x%" PRIx64, |
| 789 | create_info->size, kMaxDeviceMemory); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 790 | if (!allocator) |
| 791 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 792 | Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation( |
| 793 | allocator->pUserData, sizeof(Buffer), alignof(Buffer), |
| 794 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 795 | if (!buffer) |
| 796 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 797 | buffer->size = create_info->size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 798 | *buffer_handle = GetHandleToBuffer(buffer); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 799 | return VK_SUCCESS; |
| 800 | } |
| 801 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 802 | void GetBufferMemoryRequirements(VkDevice, |
| 803 | VkBuffer buffer_handle, |
| 804 | VkMemoryRequirements* requirements) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 805 | Buffer* buffer = GetBufferFromHandle(buffer_handle); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 806 | requirements->size = buffer->size; |
| 807 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 808 | requirements->memoryTypeBits = 0x1; |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 809 | } |
| 810 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 811 | void DestroyBuffer(VkDevice device, |
| 812 | VkBuffer buffer_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 813 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 814 | if (!allocator) |
| 815 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 816 | Buffer* buffer = GetBufferFromHandle(buffer_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 817 | allocator->pfnFree(allocator->pUserData, buffer); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 818 | } |
| 819 | |
| 820 | // ----------------------------------------------------------------------------- |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 821 | // Image |
| 822 | |
| 823 | struct Image { |
| 824 | typedef VkImage HandleType; |
| 825 | VkDeviceSize size; |
| 826 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 827 | DEFINE_OBJECT_HANDLE_CONVERSION(Image) |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 828 | |
| 829 | VkResult CreateImage(VkDevice device, |
| 830 | const VkImageCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 831 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 832 | VkImage* image_handle) { |
| 833 | if (create_info->imageType != VK_IMAGE_TYPE_2D || |
| 834 | create_info->format != VK_FORMAT_R8G8B8A8_UNORM || |
| 835 | create_info->mipLevels != 1) { |
| 836 | ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u", |
| 837 | create_info->imageType, create_info->format, |
| 838 | create_info->mipLevels); |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 839 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 840 | } |
| 841 | |
| 842 | VkDeviceSize size = |
| 843 | VkDeviceSize(create_info->extent.width * create_info->extent.height) * |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 844 | create_info->arrayLayers * create_info->samples * 4u; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 845 | ALOGW_IF(size > kMaxDeviceMemory, |
| 846 | "CreateImage: image size 0x%" PRIx64 |
| 847 | " exceeds max device memory size 0x%" PRIx64, |
| 848 | size, kMaxDeviceMemory); |
| 849 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 850 | if (!allocator) |
| 851 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 852 | Image* image = static_cast<Image*>(allocator->pfnAllocation( |
| 853 | allocator->pUserData, sizeof(Image), alignof(Image), |
| 854 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 855 | if (!image) |
| 856 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 857 | image->size = size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 858 | *image_handle = GetHandleToImage(image); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 859 | return VK_SUCCESS; |
| 860 | } |
| 861 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 862 | void GetImageMemoryRequirements(VkDevice, |
| 863 | VkImage image_handle, |
| 864 | VkMemoryRequirements* requirements) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 865 | Image* image = GetImageFromHandle(image_handle); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 866 | requirements->size = image->size; |
| 867 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 868 | requirements->memoryTypeBits = 0x1; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 869 | } |
| 870 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 871 | void DestroyImage(VkDevice device, |
| 872 | VkImage image_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 873 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 874 | if (!allocator) |
| 875 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 876 | Image* image = GetImageFromHandle(image_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 877 | allocator->pfnFree(allocator->pUserData, image); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 878 | } |
| 879 | |
Jesse Hall | 57f7f8c | 2016-01-17 17:21:36 -0800 | [diff] [blame] | 880 | VkResult GetSwapchainGrallocUsageANDROID(VkDevice, |
| 881 | VkFormat, |
| 882 | VkImageUsageFlags, |
| 883 | int* grallocUsage) { |
| 884 | // The null driver never reads or writes the gralloc buffer |
| 885 | *grallocUsage = 0; |
| 886 | return VK_SUCCESS; |
| 887 | } |
| 888 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame^] | 889 | VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice, |
| 890 | VkFormat, |
| 891 | VkImageUsageFlags, |
| 892 | VkSwapchainImageUsageFlagsANDROID, |
| 893 | int* grallocUsage) { |
| 894 | // The null driver never reads or writes the gralloc buffer |
| 895 | *grallocUsage = 0; |
| 896 | return VK_SUCCESS; |
| 897 | } |
| 898 | |
Jesse Hall | 57f7f8c | 2016-01-17 17:21:36 -0800 | [diff] [blame] | 899 | VkResult AcquireImageANDROID(VkDevice, |
| 900 | VkImage, |
| 901 | int fence, |
| 902 | VkSemaphore, |
| 903 | VkFence) { |
| 904 | close(fence); |
| 905 | return VK_SUCCESS; |
| 906 | } |
| 907 | |
| 908 | VkResult QueueSignalReleaseImageANDROID(VkQueue, |
| 909 | uint32_t, |
| 910 | const VkSemaphore*, |
| 911 | VkImage, |
| 912 | int* fence) { |
| 913 | *fence = -1; |
| 914 | return VK_SUCCESS; |
| 915 | } |
| 916 | |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 917 | // ----------------------------------------------------------------------------- |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 918 | // No-op types |
| 919 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 920 | VkResult CreateBufferView(VkDevice device, |
| 921 | const VkBufferViewCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 922 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 923 | VkBufferView* view) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 924 | *view = AllocHandle<VkBufferView>(device, HandleType::kBufferView); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 925 | return VK_SUCCESS; |
| 926 | } |
| 927 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 928 | VkResult CreateDescriptorPool(VkDevice device, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 929 | const VkDescriptorPoolCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 930 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 931 | VkDescriptorPool* pool) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 932 | *pool = AllocHandle<VkDescriptorPool>(device, HandleType::kDescriptorPool); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 933 | return VK_SUCCESS; |
| 934 | } |
| 935 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 936 | VkResult AllocateDescriptorSets(VkDevice device, |
| 937 | const VkDescriptorSetAllocateInfo* alloc_info, |
| 938 | VkDescriptorSet* descriptor_sets) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 939 | for (uint32_t i = 0; i < alloc_info->descriptorSetCount; i++) |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 940 | descriptor_sets[i] = |
| 941 | AllocHandle<VkDescriptorSet>(device, HandleType::kDescriptorSet); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 942 | return VK_SUCCESS; |
| 943 | } |
| 944 | |
| 945 | VkResult CreateDescriptorSetLayout(VkDevice device, |
| 946 | const VkDescriptorSetLayoutCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 947 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 948 | VkDescriptorSetLayout* layout) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 949 | *layout = AllocHandle<VkDescriptorSetLayout>( |
| 950 | device, HandleType::kDescriptorSetLayout); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 951 | return VK_SUCCESS; |
| 952 | } |
| 953 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 954 | VkResult CreateEvent(VkDevice device, |
| 955 | const VkEventCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 956 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 957 | VkEvent* event) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 958 | *event = AllocHandle<VkEvent>(device, HandleType::kEvent); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 959 | return VK_SUCCESS; |
| 960 | } |
| 961 | |
| 962 | VkResult CreateFence(VkDevice device, |
| 963 | const VkFenceCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 964 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 965 | VkFence* fence) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 966 | *fence = AllocHandle<VkFence>(device, HandleType::kFence); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 967 | return VK_SUCCESS; |
| 968 | } |
| 969 | |
| 970 | VkResult CreateFramebuffer(VkDevice device, |
| 971 | const VkFramebufferCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 972 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 973 | VkFramebuffer* framebuffer) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 974 | *framebuffer = AllocHandle<VkFramebuffer>(device, HandleType::kFramebuffer); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 975 | return VK_SUCCESS; |
| 976 | } |
| 977 | |
| 978 | VkResult CreateImageView(VkDevice device, |
| 979 | const VkImageViewCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 980 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 981 | VkImageView* view) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 982 | *view = AllocHandle<VkImageView>(device, HandleType::kImageView); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 983 | return VK_SUCCESS; |
| 984 | } |
| 985 | |
| 986 | VkResult CreateGraphicsPipelines(VkDevice device, |
| 987 | VkPipelineCache, |
| 988 | uint32_t count, |
| 989 | const VkGraphicsPipelineCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 990 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 991 | VkPipeline* pipelines) { |
| 992 | for (uint32_t i = 0; i < count; i++) |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 993 | pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 994 | return VK_SUCCESS; |
| 995 | } |
| 996 | |
| 997 | VkResult CreateComputePipelines(VkDevice device, |
| 998 | VkPipelineCache, |
| 999 | uint32_t count, |
| 1000 | const VkComputePipelineCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1001 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1002 | VkPipeline* pipelines) { |
| 1003 | for (uint32_t i = 0; i < count; i++) |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1004 | pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1005 | return VK_SUCCESS; |
| 1006 | } |
| 1007 | |
| 1008 | VkResult CreatePipelineCache(VkDevice device, |
| 1009 | const VkPipelineCacheCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1010 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1011 | VkPipelineCache* cache) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1012 | *cache = AllocHandle<VkPipelineCache>(device, HandleType::kPipelineCache); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1013 | return VK_SUCCESS; |
| 1014 | } |
| 1015 | |
| 1016 | VkResult CreatePipelineLayout(VkDevice device, |
| 1017 | const VkPipelineLayoutCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1018 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1019 | VkPipelineLayout* layout) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1020 | *layout = |
| 1021 | AllocHandle<VkPipelineLayout>(device, HandleType::kPipelineLayout); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1022 | return VK_SUCCESS; |
| 1023 | } |
| 1024 | |
| 1025 | VkResult CreateQueryPool(VkDevice device, |
| 1026 | const VkQueryPoolCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1027 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1028 | VkQueryPool* pool) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1029 | *pool = AllocHandle<VkQueryPool>(device, HandleType::kQueryPool); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1030 | return VK_SUCCESS; |
| 1031 | } |
| 1032 | |
| 1033 | VkResult CreateRenderPass(VkDevice device, |
| 1034 | const VkRenderPassCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1035 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1036 | VkRenderPass* renderpass) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1037 | *renderpass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1038 | return VK_SUCCESS; |
| 1039 | } |
| 1040 | |
| 1041 | VkResult CreateSampler(VkDevice device, |
| 1042 | const VkSamplerCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1043 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1044 | VkSampler* sampler) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1045 | *sampler = AllocHandle<VkSampler>(device, HandleType::kSampler); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1046 | return VK_SUCCESS; |
| 1047 | } |
| 1048 | |
| 1049 | VkResult CreateSemaphore(VkDevice device, |
| 1050 | const VkSemaphoreCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1051 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1052 | VkSemaphore* semaphore) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1053 | *semaphore = AllocHandle<VkSemaphore>(device, HandleType::kSemaphore); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1054 | return VK_SUCCESS; |
| 1055 | } |
| 1056 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1057 | VkResult CreateShaderModule(VkDevice device, |
| 1058 | const VkShaderModuleCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1059 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1060 | VkShaderModule* module) { |
Michael Lentine | 3fec89e | 2015-12-04 16:25:11 -0800 | [diff] [blame] | 1061 | *module = AllocHandle<VkShaderModule>(device, HandleType::kShaderModule); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1062 | return VK_SUCCESS; |
| 1063 | } |
| 1064 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1065 | VkResult CreateDebugReportCallbackEXT(VkInstance instance, |
| 1066 | const VkDebugReportCallbackCreateInfoEXT*, |
| 1067 | const VkAllocationCallbacks*, |
| 1068 | VkDebugReportCallbackEXT* callback) { |
| 1069 | *callback = AllocHandle<VkDebugReportCallbackEXT>( |
| 1070 | instance, HandleType::kDebugReportCallbackEXT); |
| 1071 | return VK_SUCCESS; |
| 1072 | } |
| 1073 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 1074 | // ----------------------------------------------------------------------------- |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1075 | // No-op entrypoints |
| 1076 | |
| 1077 | // clang-format off |
| 1078 | #pragma clang diagnostic push |
| 1079 | #pragma clang diagnostic ignored "-Wunused-parameter" |
| 1080 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1081 | void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1082 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1083 | } |
| 1084 | |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 1085 | 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] | 1086 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 1087 | return VK_SUCCESS; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1088 | } |
| 1089 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1090 | VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1091 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1092 | return VK_SUCCESS; |
| 1093 | } |
| 1094 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1095 | VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1096 | return VK_SUCCESS; |
| 1097 | } |
| 1098 | |
| 1099 | VkResult QueueWaitIdle(VkQueue queue) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1100 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1101 | return VK_SUCCESS; |
| 1102 | } |
| 1103 | |
| 1104 | VkResult DeviceWaitIdle(VkDevice device) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1105 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1106 | return VK_SUCCESS; |
| 1107 | } |
| 1108 | |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 1109 | void UnmapMemory(VkDevice device, VkDeviceMemory mem) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1110 | } |
| 1111 | |
| 1112 | VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1113 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1114 | return VK_SUCCESS; |
| 1115 | } |
| 1116 | |
| 1117 | VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1118 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1119 | return VK_SUCCESS; |
| 1120 | } |
| 1121 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1122 | void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1123 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1124 | } |
| 1125 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1126 | VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 1127 | return VK_SUCCESS; |
| 1128 | } |
| 1129 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1130 | VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 1131 | return VK_SUCCESS; |
| 1132 | } |
| 1133 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1134 | void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1135 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1136 | } |
| 1137 | |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1138 | 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] | 1139 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1140 | } |
| 1141 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1142 | VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1143 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1144 | return VK_SUCCESS; |
| 1145 | } |
| 1146 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1147 | void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1148 | } |
| 1149 | |
| 1150 | VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) { |
| 1151 | return VK_SUCCESS; |
| 1152 | } |
| 1153 | |
| 1154 | VkResult GetFenceStatus(VkDevice device, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1155 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1156 | return VK_SUCCESS; |
| 1157 | } |
| 1158 | |
| 1159 | VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) { |
| 1160 | return VK_SUCCESS; |
| 1161 | } |
| 1162 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1163 | void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1164 | } |
| 1165 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1166 | void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1167 | } |
| 1168 | |
| 1169 | VkResult GetEventStatus(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1170 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1171 | return VK_SUCCESS; |
| 1172 | } |
| 1173 | |
| 1174 | VkResult SetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1175 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1176 | return VK_SUCCESS; |
| 1177 | } |
| 1178 | |
| 1179 | VkResult ResetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1180 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1181 | return VK_SUCCESS; |
| 1182 | } |
| 1183 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1184 | void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1185 | } |
| 1186 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1187 | 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] | 1188 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1189 | return VK_SUCCESS; |
| 1190 | } |
| 1191 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1192 | void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1193 | } |
| 1194 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1195 | void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1196 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1197 | } |
| 1198 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1199 | void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1200 | } |
| 1201 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1202 | void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1203 | } |
| 1204 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1205 | void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1206 | } |
| 1207 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1208 | VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1209 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1210 | return VK_SUCCESS; |
| 1211 | } |
| 1212 | |
| 1213 | VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1214 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1215 | return VK_SUCCESS; |
| 1216 | } |
| 1217 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1218 | void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1219 | } |
| 1220 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1221 | void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1222 | } |
| 1223 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1224 | void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1225 | } |
| 1226 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1227 | void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1228 | } |
| 1229 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1230 | void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1231 | } |
| 1232 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1233 | VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1234 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1235 | return VK_SUCCESS; |
| 1236 | } |
| 1237 | |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 1238 | 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] | 1239 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1240 | } |
| 1241 | |
| 1242 | VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1243 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1244 | return VK_SUCCESS; |
| 1245 | } |
| 1246 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1247 | void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1248 | } |
| 1249 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1250 | void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1251 | } |
| 1252 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 1253 | void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1254 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1255 | } |
| 1256 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1257 | VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1258 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1259 | return VK_SUCCESS; |
| 1260 | } |
| 1261 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1262 | VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1263 | return VK_SUCCESS; |
| 1264 | } |
| 1265 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1266 | VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1267 | return VK_SUCCESS; |
| 1268 | } |
| 1269 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1270 | VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 1271 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1272 | return VK_SUCCESS; |
| 1273 | } |
| 1274 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1275 | void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1276 | } |
| 1277 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1278 | 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] | 1279 | } |
| 1280 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1281 | 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] | 1282 | } |
| 1283 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1284 | void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1285 | } |
| 1286 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1287 | void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1288 | } |
| 1289 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1290 | void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1291 | } |
| 1292 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1293 | void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1294 | } |
| 1295 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1296 | void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1297 | } |
| 1298 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1299 | void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1300 | } |
| 1301 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1302 | void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1303 | } |
| 1304 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1305 | 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] | 1306 | } |
| 1307 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1308 | void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1309 | } |
| 1310 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1311 | 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] | 1312 | } |
| 1313 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1314 | 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] | 1315 | } |
| 1316 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1317 | 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] | 1318 | } |
| 1319 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1320 | 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] | 1321 | } |
| 1322 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1323 | 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] | 1324 | } |
| 1325 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1326 | 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] | 1327 | } |
| 1328 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1329 | void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) { |
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 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] | 1333 | } |
| 1334 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1335 | 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] | 1336 | } |
| 1337 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1338 | 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] | 1339 | } |
| 1340 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1341 | 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] | 1342 | } |
| 1343 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1344 | 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] | 1345 | } |
| 1346 | |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 1347 | 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] | 1348 | } |
| 1349 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1350 | 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] | 1351 | } |
| 1352 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1353 | 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] | 1354 | } |
| 1355 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1356 | 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] | 1357 | } |
| 1358 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1359 | 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] | 1360 | } |
| 1361 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1362 | 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] | 1363 | } |
| 1364 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1365 | void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1366 | } |
| 1367 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1368 | void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1369 | } |
| 1370 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1371 | 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] | 1372 | } |
| 1373 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1374 | 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] | 1375 | } |
| 1376 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1377 | void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1378 | } |
| 1379 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1380 | void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1381 | } |
| 1382 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1383 | void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) { |
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 CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) { |
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 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] | 1390 | } |
| 1391 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1392 | 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] | 1393 | } |
| 1394 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1395 | void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1396 | } |
| 1397 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1398 | void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1399 | } |
| 1400 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1401 | void CmdEndRenderPass(VkCommandBuffer cmdBuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1402 | } |
| 1403 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1404 | void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1405 | } |
| 1406 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1407 | void DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) { |
| 1408 | } |
| 1409 | |
| 1410 | void DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) { |
| 1411 | } |
| 1412 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1413 | #pragma clang diagnostic pop |
| 1414 | // clang-format on |
| 1415 | |
| 1416 | } // namespace null_driver |