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