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