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