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 | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 19 | #include <array> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 20 | #include <algorithm> |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [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 | // #define LOG_NDEBUG 0 |
| 25 | #include <log/log.h> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 26 | #include <utils/Errors.h> |
| 27 | |
| 28 | #include "null_driver.h" |
| 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; |
| 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 | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 70 | kDescriptorPool, |
| 71 | kDescriptorSet, |
| 72 | kDescriptorSetLayout, |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 73 | kEvent, |
| 74 | kFence, |
| 75 | kFramebuffer, |
| 76 | kImageView, |
| 77 | kPipeline, |
| 78 | kPipelineCache, |
| 79 | kPipelineLayout, |
| 80 | kQueryPool, |
| 81 | kRenderPass, |
| 82 | kSampler, |
| 83 | kSemaphore, |
| 84 | kShader, |
| 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 | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 90 | uint64_t AllocHandle(VkDevice device, HandleType::Enum type); |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 91 | |
| 92 | const VkDeviceSize kMaxDeviceMemory = VkDeviceSize(INTPTR_MAX) + 1; |
| 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 | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 133 | VkResult CreateInstance(const VkInstanceCreateInfo* /*create_info*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 134 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 135 | VkInstance* out_instance) { |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame] | 136 | // Assume the loader provided alloc callbacks even if the app didn't. |
| 137 | ALOG_ASSERT( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 138 | allocator, |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame] | 139 | "Missing alloc callbacks, loader or app should have provided them"); |
| 140 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 141 | VkInstance_T* instance = |
| 142 | static_cast<VkInstance_T*>(allocator->pfnAllocation( |
| 143 | allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T), |
| 144 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 145 | if (!instance) |
| 146 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 147 | |
| 148 | instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 149 | instance->allocator = *allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 150 | instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 151 | |
| 152 | *out_instance = instance; |
| 153 | return VK_SUCCESS; |
| 154 | } |
| 155 | |
| 156 | int CloseDevice(struct hw_device_t* /*device*/) { |
| 157 | // nothing to do - opening a device doesn't allocate any resources |
| 158 | return 0; |
| 159 | } |
| 160 | |
| 161 | hwvulkan_device_t nulldrv_device = { |
| 162 | .common = |
| 163 | { |
Michael Lentine | 03c64b0 | 2015-08-26 18:27:26 -0500 | [diff] [blame] | 164 | .tag = HARDWARE_DEVICE_TAG, |
| 165 | .version = HWVULKAN_DEVICE_API_VERSION_0_1, |
| 166 | .module = &HAL_MODULE_INFO_SYM.common, |
| 167 | .close = CloseDevice, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 168 | }, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 169 | .EnumerateInstanceExtensionProperties = |
| 170 | EnumerateInstanceExtensionProperties, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 171 | .CreateInstance = CreateInstance, |
| 172 | .GetInstanceProcAddr = GetInstanceProcAddr}; |
| 173 | |
| 174 | int OpenDevice(const hw_module_t* /*module*/, |
| 175 | const char* id, |
| 176 | hw_device_t** device) { |
| 177 | if (strcmp(id, HWVULKAN_DEVICE_0) == 0) { |
| 178 | *device = &nulldrv_device.common; |
| 179 | return 0; |
| 180 | } |
| 181 | return -ENOENT; |
| 182 | } |
| 183 | |
| 184 | VkInstance_T* GetInstanceFromPhysicalDevice( |
| 185 | VkPhysicalDevice_T* physical_device) { |
| 186 | return reinterpret_cast<VkInstance_T*>( |
| 187 | reinterpret_cast<uintptr_t>(physical_device) - |
| 188 | offsetof(VkInstance_T, physical_device)); |
| 189 | } |
| 190 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 191 | uint64_t AllocHandle(VkDevice device, HandleType::Enum type) { |
| 192 | const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1; |
| 193 | ALOGE_IF(device->next_handle[type] == kHandleMask, |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 194 | "non-dispatchable handles of type=%u are about to overflow", type); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 195 | return (UINT64_C(1) << 63) | ((uint64_t(type) & 0x7) << 56) | |
| 196 | (device->next_handle[type]++ & kHandleMask); |
| 197 | } |
| 198 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 199 | } // namespace |
| 200 | |
| 201 | namespace null_driver { |
| 202 | |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 203 | #define DEFINE_OBJECT_HANDLE_CONVERSION(T) \ |
| 204 | T* Get##T##FromHandle(Vk##T h); \ |
| 205 | T* Get##T##FromHandle(Vk##T h) { \ |
| 206 | return reinterpret_cast<T*>(uintptr_t(h)); \ |
| 207 | } \ |
| 208 | Vk##T GetHandleTo##T(const T* obj); \ |
| 209 | Vk##T GetHandleTo##T(const T* obj) { \ |
| 210 | return Vk##T(reinterpret_cast<uintptr_t>(obj)); \ |
| 211 | } |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 212 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 213 | // ----------------------------------------------------------------------------- |
| 214 | // Global |
| 215 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 216 | VkResult EnumerateInstanceExtensionProperties(const char*, |
| 217 | uint32_t* count, |
| 218 | VkExtensionProperties*) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 219 | *count = 0; |
| 220 | return VK_SUCCESS; |
| 221 | } |
| 222 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 223 | PFN_vkVoidFunction GetInstanceProcAddr(VkInstance, const char* name) { |
| 224 | PFN_vkVoidFunction proc = LookupInstanceProcAddr(name); |
| 225 | if (!proc && strcmp(name, "vkGetDeviceProcAddr") == 0) |
| 226 | proc = reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr); |
| 227 | return proc; |
| 228 | } |
| 229 | |
| 230 | PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) { |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame] | 231 | PFN_vkVoidFunction proc = LookupDeviceProcAddr(name); |
| 232 | if (proc) |
| 233 | return proc; |
Jesse Hall | 70f9335 | 2015-11-04 09:41:31 -0800 | [diff] [blame] | 234 | if (strcmp(name, "vkGetSwapchainGrallocUsageANDROID") == 0) |
| 235 | return reinterpret_cast<PFN_vkVoidFunction>( |
| 236 | GetSwapchainGrallocUsageANDROID); |
Jesse Hall | ab9aeef | 2015-11-04 10:56:20 -0800 | [diff] [blame] | 237 | if (strcmp(name, "vkAcquireImageANDROID") == 0) |
| 238 | return reinterpret_cast<PFN_vkVoidFunction>(AcquireImageANDROID); |
| 239 | if (strcmp(name, "vkQueueSignalReleaseImageANDROID") == 0) |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame] | 240 | return reinterpret_cast<PFN_vkVoidFunction>( |
Jesse Hall | ab9aeef | 2015-11-04 10:56:20 -0800 | [diff] [blame] | 241 | QueueSignalReleaseImageANDROID); |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame] | 242 | return nullptr; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 243 | } |
| 244 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 245 | // ----------------------------------------------------------------------------- |
| 246 | // Instance |
| 247 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 248 | void DestroyInstance(VkInstance instance, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 249 | const VkAllocationCallbacks* /*allocator*/) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 250 | instance->allocator.pfnFree(instance->allocator.pUserData, instance); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 253 | // ----------------------------------------------------------------------------- |
| 254 | // PhysicalDevice |
| 255 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 256 | VkResult EnumeratePhysicalDevices(VkInstance instance, |
| 257 | uint32_t* physical_device_count, |
| 258 | VkPhysicalDevice* physical_devices) { |
| 259 | if (physical_devices && *physical_device_count >= 1) |
| 260 | physical_devices[0] = &instance->physical_device; |
| 261 | *physical_device_count = 1; |
| 262 | return VK_SUCCESS; |
| 263 | } |
| 264 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 265 | void GetPhysicalDeviceProperties(VkPhysicalDevice, |
| 266 | VkPhysicalDeviceProperties* properties) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 267 | properties->apiVersion = VK_API_VERSION; |
| 268 | properties->driverVersion = VK_MAKE_VERSION(0, 0, 1); |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 269 | properties->vendorId = 0; |
| 270 | properties->deviceId = 0; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 271 | properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; |
| 272 | strcpy(properties->deviceName, "Android Vulkan Null Driver"); |
| 273 | memset(properties->pipelineCacheUUID, 0, |
| 274 | sizeof(properties->pipelineCacheUUID)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 277 | void GetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 278 | VkPhysicalDevice, |
| 279 | uint32_t* count, |
| 280 | VkQueueFamilyProperties* properties) { |
| 281 | if (properties) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 282 | properties->queueFlags = |
| 283 | VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_DMA_BIT; |
| 284 | properties->queueCount = 1; |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 285 | properties->timestampValidBits = 64; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 286 | } |
| 287 | *count = 1; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 288 | } |
| 289 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 290 | void GetPhysicalDeviceMemoryProperties( |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 291 | VkPhysicalDevice, |
| 292 | VkPhysicalDeviceMemoryProperties* properties) { |
| 293 | properties->memoryTypeCount = 1; |
| 294 | properties->memoryTypes[0].propertyFlags = |
| 295 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; |
| 296 | properties->memoryTypes[0].heapIndex = 0; |
| 297 | properties->memoryHeapCount = 1; |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 298 | properties->memoryHeaps[0].size = kMaxDeviceMemory; |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 299 | properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_HOST_LOCAL_BIT; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 300 | } |
| 301 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 302 | // ----------------------------------------------------------------------------- |
| 303 | // Device |
| 304 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 305 | VkResult CreateDevice(VkPhysicalDevice physical_device, |
| 306 | const VkDeviceCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 307 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 308 | VkDevice* out_device) { |
| 309 | VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 310 | if (!allocator) |
| 311 | allocator = &instance->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 312 | VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation( |
| 313 | allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T), |
| 314 | VK_SYSTEM_ALLOCATION_SCOPE_DEVICE)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 315 | if (!device) |
| 316 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 317 | |
| 318 | device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 319 | device->allocator = *allocator; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 320 | device->instance = instance; |
| 321 | device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 322 | std::fill(device->next_handle.begin(), device->next_handle.end(), |
| 323 | UINT64_C(0)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 324 | |
| 325 | *out_device = device; |
| 326 | return VK_SUCCESS; |
| 327 | } |
| 328 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 329 | void DestroyDevice(VkDevice device, |
| 330 | const VkAllocationCallbacks* /*allocator*/) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 331 | if (!device) |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 332 | return; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 333 | device->allocator.pfnFree(device->allocator.pUserData, device); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 334 | } |
| 335 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 336 | void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 337 | *queue = &device->queue; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 338 | } |
| 339 | |
| 340 | // ----------------------------------------------------------------------------- |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 341 | // CommandPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 342 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 343 | struct CommandPool { |
| 344 | typedef VkCommandPool HandleType; |
| 345 | VkAllocationCallbacks allocator; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 346 | }; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 347 | DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 348 | |
| 349 | VkResult CreateCommandPool(VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 350 | const VkCommandPoolCreateInfo* /*create_info*/, |
| 351 | const VkAllocationCallbacks* allocator, |
| 352 | VkCommandPool* cmd_pool) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 353 | if (!allocator) |
| 354 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 355 | CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation( |
| 356 | allocator->pUserData, sizeof(CommandPool), alignof(CommandPool), |
| 357 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 358 | if (!pool) |
| 359 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 360 | pool->allocator = *allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 361 | *cmd_pool = GetHandleToCommandPool(pool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 362 | return VK_SUCCESS; |
| 363 | } |
| 364 | |
| 365 | void DestroyCommandPool(VkDevice /*device*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 366 | VkCommandPool cmd_pool, |
| 367 | const VkAllocationCallbacks* /*allocator*/) { |
| 368 | CommandPool* pool = GetCommandPoolFromHandle(cmd_pool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 369 | pool->allocator.pfnFree(pool->allocator.pUserData, pool); |
| 370 | } |
| 371 | |
| 372 | // ----------------------------------------------------------------------------- |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 373 | // CmdBuffer |
| 374 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 375 | VkResult AllocateCommandBuffers(VkDevice /*device*/, |
| 376 | const VkCommandBufferAllocateInfo* alloc_info, |
| 377 | VkCommandBuffer* cmdbufs) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 378 | VkResult result = VK_SUCCESS; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 379 | CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 380 | std::fill(cmdbufs, cmdbufs + alloc_info->bufferCount, nullptr); |
| 381 | for (uint32_t i = 0; i < alloc_info->bufferCount; i++) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 382 | cmdbufs[i] = |
| 383 | static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation( |
| 384 | pool.allocator.pUserData, sizeof(VkCommandBuffer_T), |
| 385 | alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 386 | if (!cmdbufs[i]) { |
| 387 | result = VK_ERROR_OUT_OF_HOST_MEMORY; |
| 388 | break; |
| 389 | } |
| 390 | cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 391 | } |
| 392 | if (result != VK_SUCCESS) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 393 | for (uint32_t i = 0; i < alloc_info->bufferCount; i++) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 394 | if (!cmdbufs[i]) |
| 395 | break; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 396 | pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 397 | } |
| 398 | } |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 399 | return result; |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 400 | } |
| 401 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 402 | void FreeCommandBuffers(VkDevice /*device*/, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 403 | VkCommandPool cmd_pool, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 404 | uint32_t count, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 405 | const VkCommandBuffer* cmdbufs) { |
| 406 | CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool); |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 407 | for (uint32_t i = 0; i < count; i++) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 408 | pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]); |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | // ----------------------------------------------------------------------------- |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 412 | // DeviceMemory |
| 413 | |
| 414 | struct DeviceMemory { |
| 415 | typedef VkDeviceMemory HandleType; |
| 416 | VkDeviceSize size; |
| 417 | alignas(16) uint8_t data[0]; |
| 418 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 419 | DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory) |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 420 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 421 | VkResult AllocateMemory(VkDevice device, |
| 422 | const VkMemoryAllocateInfo* alloc_info, |
| 423 | const VkAllocationCallbacks* allocator, |
| 424 | VkDeviceMemory* mem_handle) { |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 425 | if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize) |
| 426 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 427 | if (!allocator) |
| 428 | allocator = &device->allocator; |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 429 | |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 430 | size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize); |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 431 | DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation( |
| 432 | allocator->pUserData, size, alignof(DeviceMemory), |
| 433 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 434 | if (!mem) |
| 435 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 436 | mem->size = size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 437 | *mem_handle = GetHandleToDeviceMemory(mem); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 438 | return VK_SUCCESS; |
| 439 | } |
| 440 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 441 | void FreeMemory(VkDevice device, |
| 442 | VkDeviceMemory mem_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 443 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 444 | if (!allocator) |
| 445 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 446 | DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 447 | allocator->pfnFree(allocator->pUserData, mem); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | VkResult MapMemory(VkDevice, |
| 451 | VkDeviceMemory mem_handle, |
| 452 | VkDeviceSize offset, |
| 453 | VkDeviceSize, |
| 454 | VkMemoryMapFlags, |
| 455 | void** out_ptr) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 456 | DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle); |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 457 | *out_ptr = &mem->data[0] + offset; |
| 458 | return VK_SUCCESS; |
| 459 | } |
| 460 | |
| 461 | // ----------------------------------------------------------------------------- |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 462 | // Buffer |
| 463 | |
| 464 | struct Buffer { |
| 465 | typedef VkBuffer HandleType; |
| 466 | VkDeviceSize size; |
| 467 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 468 | DEFINE_OBJECT_HANDLE_CONVERSION(Buffer) |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 469 | |
| 470 | VkResult CreateBuffer(VkDevice device, |
| 471 | const VkBufferCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 472 | const VkAllocationCallbacks* allocator, |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 473 | VkBuffer* buffer_handle) { |
Jesse Hall | bde8ee3 | 2015-09-01 16:24:29 -0700 | [diff] [blame] | 474 | ALOGW_IF(create_info->size > kMaxDeviceMemory, |
| 475 | "CreateBuffer: requested size 0x%" PRIx64 |
| 476 | " exceeds max device memory size 0x%" PRIx64, |
| 477 | create_info->size, kMaxDeviceMemory); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 478 | if (!allocator) |
| 479 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 480 | Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation( |
| 481 | allocator->pUserData, sizeof(Buffer), alignof(Buffer), |
| 482 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 483 | if (!buffer) |
| 484 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 485 | buffer->size = create_info->size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 486 | *buffer_handle = GetHandleToBuffer(buffer); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 487 | return VK_SUCCESS; |
| 488 | } |
| 489 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 490 | void GetBufferMemoryRequirements(VkDevice, |
| 491 | VkBuffer buffer_handle, |
| 492 | VkMemoryRequirements* requirements) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 493 | Buffer* buffer = GetBufferFromHandle(buffer_handle); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 494 | requirements->size = buffer->size; |
| 495 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 496 | requirements->memoryTypeBits = 0x1; |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 497 | } |
| 498 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 499 | void DestroyBuffer(VkDevice device, |
| 500 | VkBuffer buffer_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 501 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 502 | if (!allocator) |
| 503 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 504 | Buffer* buffer = GetBufferFromHandle(buffer_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 505 | allocator->pfnFree(allocator->pUserData, buffer); |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 506 | } |
| 507 | |
| 508 | // ----------------------------------------------------------------------------- |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 509 | // Image |
| 510 | |
| 511 | struct Image { |
| 512 | typedef VkImage HandleType; |
| 513 | VkDeviceSize size; |
| 514 | }; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 515 | DEFINE_OBJECT_HANDLE_CONVERSION(Image) |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 516 | |
| 517 | VkResult CreateImage(VkDevice device, |
| 518 | const VkImageCreateInfo* create_info, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 519 | const VkAllocationCallbacks* allocator, |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 520 | VkImage* image_handle) { |
| 521 | if (create_info->imageType != VK_IMAGE_TYPE_2D || |
| 522 | create_info->format != VK_FORMAT_R8G8B8A8_UNORM || |
| 523 | create_info->mipLevels != 1) { |
| 524 | ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u", |
| 525 | create_info->imageType, create_info->format, |
| 526 | create_info->mipLevels); |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 527 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | VkDeviceSize size = |
| 531 | VkDeviceSize(create_info->extent.width * create_info->extent.height) * |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 532 | create_info->arrayLayers * create_info->samples * 4u; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 533 | ALOGW_IF(size > kMaxDeviceMemory, |
| 534 | "CreateImage: image size 0x%" PRIx64 |
| 535 | " exceeds max device memory size 0x%" PRIx64, |
| 536 | size, kMaxDeviceMemory); |
| 537 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 538 | if (!allocator) |
| 539 | allocator = &device->allocator; |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 540 | Image* image = static_cast<Image*>(allocator->pfnAllocation( |
| 541 | allocator->pUserData, sizeof(Image), alignof(Image), |
| 542 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 543 | if (!image) |
| 544 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 545 | image->size = size; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 546 | *image_handle = GetHandleToImage(image); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 547 | return VK_SUCCESS; |
| 548 | } |
| 549 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 550 | void GetImageMemoryRequirements(VkDevice, |
| 551 | VkImage image_handle, |
| 552 | VkMemoryRequirements* requirements) { |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 553 | Image* image = GetImageFromHandle(image_handle); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 554 | requirements->size = image->size; |
| 555 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 556 | requirements->memoryTypeBits = 0x1; |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 557 | } |
| 558 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 559 | void DestroyImage(VkDevice device, |
| 560 | VkImage image_handle, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 561 | const VkAllocationCallbacks* allocator) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 562 | if (!allocator) |
| 563 | allocator = &device->allocator; |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 564 | Image* image = GetImageFromHandle(image_handle); |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 565 | allocator->pfnFree(allocator->pUserData, image); |
Jesse Hall | 85c05b6 | 2015-09-01 18:07:41 -0700 | [diff] [blame] | 566 | } |
| 567 | |
| 568 | // ----------------------------------------------------------------------------- |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 569 | // No-op types |
| 570 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 571 | VkResult CreateBufferView(VkDevice device, |
| 572 | const VkBufferViewCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 573 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 574 | VkBufferView* view) { |
| 575 | *view = AllocHandle(device, HandleType::kBufferView); |
| 576 | return VK_SUCCESS; |
| 577 | } |
| 578 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 579 | VkResult CreateDescriptorPool(VkDevice device, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 580 | const VkDescriptorPoolCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 581 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 582 | VkDescriptorPool* pool) { |
| 583 | *pool = AllocHandle(device, HandleType::kDescriptorPool); |
| 584 | return VK_SUCCESS; |
| 585 | } |
| 586 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 587 | VkResult AllocateDescriptorSets(VkDevice device, |
| 588 | const VkDescriptorSetAllocateInfo* alloc_info, |
| 589 | VkDescriptorSet* descriptor_sets) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 590 | for (uint32_t i = 0; i < alloc_info->setLayoutCount; i++) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 591 | descriptor_sets[i] = AllocHandle(device, HandleType::kDescriptorSet); |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 592 | return VK_SUCCESS; |
| 593 | } |
| 594 | |
| 595 | VkResult CreateDescriptorSetLayout(VkDevice device, |
| 596 | const VkDescriptorSetLayoutCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 597 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 598 | VkDescriptorSetLayout* layout) { |
| 599 | *layout = AllocHandle(device, HandleType::kDescriptorSetLayout); |
| 600 | return VK_SUCCESS; |
| 601 | } |
| 602 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 603 | VkResult CreateEvent(VkDevice device, |
| 604 | const VkEventCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 605 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 606 | VkEvent* event) { |
| 607 | *event = AllocHandle(device, HandleType::kEvent); |
| 608 | return VK_SUCCESS; |
| 609 | } |
| 610 | |
| 611 | VkResult CreateFence(VkDevice device, |
| 612 | const VkFenceCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 613 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 614 | VkFence* fence) { |
| 615 | *fence = AllocHandle(device, HandleType::kFence); |
| 616 | return VK_SUCCESS; |
| 617 | } |
| 618 | |
| 619 | VkResult CreateFramebuffer(VkDevice device, |
| 620 | const VkFramebufferCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 621 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 622 | VkFramebuffer* framebuffer) { |
| 623 | *framebuffer = AllocHandle(device, HandleType::kFramebuffer); |
| 624 | return VK_SUCCESS; |
| 625 | } |
| 626 | |
| 627 | VkResult CreateImageView(VkDevice device, |
| 628 | const VkImageViewCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 629 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 630 | VkImageView* view) { |
| 631 | *view = AllocHandle(device, HandleType::kImageView); |
| 632 | return VK_SUCCESS; |
| 633 | } |
| 634 | |
| 635 | VkResult CreateGraphicsPipelines(VkDevice device, |
| 636 | VkPipelineCache, |
| 637 | uint32_t count, |
| 638 | const VkGraphicsPipelineCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 639 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 640 | VkPipeline* pipelines) { |
| 641 | for (uint32_t i = 0; i < count; i++) |
| 642 | pipelines[i] = AllocHandle(device, HandleType::kPipeline); |
| 643 | return VK_SUCCESS; |
| 644 | } |
| 645 | |
| 646 | VkResult CreateComputePipelines(VkDevice device, |
| 647 | VkPipelineCache, |
| 648 | uint32_t count, |
| 649 | const VkComputePipelineCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 650 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 651 | VkPipeline* pipelines) { |
| 652 | for (uint32_t i = 0; i < count; i++) |
| 653 | pipelines[i] = AllocHandle(device, HandleType::kPipeline); |
| 654 | return VK_SUCCESS; |
| 655 | } |
| 656 | |
| 657 | VkResult CreatePipelineCache(VkDevice device, |
| 658 | const VkPipelineCacheCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 659 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 660 | VkPipelineCache* cache) { |
| 661 | *cache = AllocHandle(device, HandleType::kPipelineCache); |
| 662 | return VK_SUCCESS; |
| 663 | } |
| 664 | |
| 665 | VkResult CreatePipelineLayout(VkDevice device, |
| 666 | const VkPipelineLayoutCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 667 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 668 | VkPipelineLayout* layout) { |
| 669 | *layout = AllocHandle(device, HandleType::kPipelineLayout); |
| 670 | return VK_SUCCESS; |
| 671 | } |
| 672 | |
| 673 | VkResult CreateQueryPool(VkDevice device, |
| 674 | const VkQueryPoolCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 675 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 676 | VkQueryPool* pool) { |
| 677 | *pool = AllocHandle(device, HandleType::kQueryPool); |
| 678 | return VK_SUCCESS; |
| 679 | } |
| 680 | |
| 681 | VkResult CreateRenderPass(VkDevice device, |
| 682 | const VkRenderPassCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 683 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 684 | VkRenderPass* renderpass) { |
| 685 | *renderpass = AllocHandle(device, HandleType::kRenderPass); |
| 686 | return VK_SUCCESS; |
| 687 | } |
| 688 | |
| 689 | VkResult CreateSampler(VkDevice device, |
| 690 | const VkSamplerCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 691 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 692 | VkSampler* sampler) { |
| 693 | *sampler = AllocHandle(device, HandleType::kSampler); |
| 694 | return VK_SUCCESS; |
| 695 | } |
| 696 | |
| 697 | VkResult CreateSemaphore(VkDevice device, |
| 698 | const VkSemaphoreCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 699 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 700 | VkSemaphore* semaphore) { |
| 701 | *semaphore = AllocHandle(device, HandleType::kSemaphore); |
| 702 | return VK_SUCCESS; |
| 703 | } |
| 704 | |
| 705 | VkResult CreateShader(VkDevice device, |
| 706 | const VkShaderCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 707 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 708 | VkShader* shader) { |
| 709 | *shader = AllocHandle(device, HandleType::kShader); |
| 710 | return VK_SUCCESS; |
| 711 | } |
| 712 | |
| 713 | VkResult CreateShaderModule(VkDevice device, |
| 714 | const VkShaderModuleCreateInfo*, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 715 | const VkAllocationCallbacks* /*allocator*/, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 716 | VkShaderModule* module) { |
| 717 | *module = AllocHandle(device, HandleType::kShaderModule); |
| 718 | return VK_SUCCESS; |
| 719 | } |
| 720 | |
Jesse Hall | 70f9335 | 2015-11-04 09:41:31 -0800 | [diff] [blame] | 721 | VkResult GetSwapchainGrallocUsageANDROID(VkDevice, |
| 722 | VkFormat, |
| 723 | VkImageUsageFlags, |
| 724 | int* grallocUsage) { |
| 725 | // The null driver never reads or writes the gralloc buffer |
| 726 | *grallocUsage = 0; |
| 727 | return VK_SUCCESS; |
| 728 | } |
| 729 | |
Jesse Hall | ab9aeef | 2015-11-04 10:56:20 -0800 | [diff] [blame] | 730 | VkResult AcquireImageANDROID(VkDevice, VkImage, int fence, VkSemaphore) { |
Jesse Hall | d7b994a | 2015-09-07 14:17:37 -0700 | [diff] [blame] | 731 | close(fence); |
| 732 | return VK_SUCCESS; |
| 733 | } |
| 734 | |
Jesse Hall | ab9aeef | 2015-11-04 10:56:20 -0800 | [diff] [blame] | 735 | VkResult QueueSignalReleaseImageANDROID(VkQueue, VkImage, int* fence) { |
Jesse Hall | d7b994a | 2015-09-07 14:17:37 -0700 | [diff] [blame] | 736 | *fence = -1; |
| 737 | return VK_SUCCESS; |
| 738 | } |
| 739 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 740 | // ----------------------------------------------------------------------------- |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 741 | // No-op entrypoints |
| 742 | |
| 743 | // clang-format off |
| 744 | #pragma clang diagnostic push |
| 745 | #pragma clang diagnostic ignored "-Wunused-parameter" |
| 746 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 747 | void GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 748 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 749 | } |
| 750 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 751 | void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 752 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 753 | } |
| 754 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 755 | void 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] | 756 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 757 | } |
| 758 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 759 | VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 760 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 761 | return VK_SUCCESS; |
| 762 | } |
| 763 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 764 | VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 765 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 766 | return VK_SUCCESS; |
| 767 | } |
| 768 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 769 | VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 770 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 771 | return VK_SUCCESS; |
| 772 | } |
| 773 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 774 | VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 775 | return VK_SUCCESS; |
| 776 | } |
| 777 | |
| 778 | VkResult QueueWaitIdle(VkQueue queue) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 779 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 780 | return VK_SUCCESS; |
| 781 | } |
| 782 | |
| 783 | VkResult DeviceWaitIdle(VkDevice device) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 784 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 785 | return VK_SUCCESS; |
| 786 | } |
| 787 | |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 788 | void UnmapMemory(VkDevice device, VkDeviceMemory mem) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 789 | } |
| 790 | |
| 791 | VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 792 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 793 | return VK_SUCCESS; |
| 794 | } |
| 795 | |
| 796 | VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 797 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 798 | return VK_SUCCESS; |
| 799 | } |
| 800 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 801 | void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 802 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 803 | } |
| 804 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 805 | VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 806 | return VK_SUCCESS; |
| 807 | } |
| 808 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 809 | VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 810 | return VK_SUCCESS; |
| 811 | } |
| 812 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 813 | void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 814 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 815 | } |
| 816 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 817 | void GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 818 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 819 | } |
| 820 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 821 | VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 822 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 823 | return VK_SUCCESS; |
| 824 | } |
| 825 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 826 | void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 827 | } |
| 828 | |
| 829 | VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) { |
| 830 | return VK_SUCCESS; |
| 831 | } |
| 832 | |
| 833 | VkResult GetFenceStatus(VkDevice device, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 834 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 835 | return VK_SUCCESS; |
| 836 | } |
| 837 | |
| 838 | VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) { |
| 839 | return VK_SUCCESS; |
| 840 | } |
| 841 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 842 | void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 843 | } |
| 844 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 845 | void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 846 | } |
| 847 | |
| 848 | VkResult GetEventStatus(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 849 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 850 | return VK_SUCCESS; |
| 851 | } |
| 852 | |
| 853 | VkResult SetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 854 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 855 | return VK_SUCCESS; |
| 856 | } |
| 857 | |
| 858 | VkResult ResetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 859 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 860 | return VK_SUCCESS; |
| 861 | } |
| 862 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 863 | void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 864 | } |
| 865 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 866 | 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] | 867 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 868 | return VK_SUCCESS; |
| 869 | } |
| 870 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 871 | void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 872 | } |
| 873 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 874 | void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 875 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 876 | } |
| 877 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 878 | void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 879 | } |
| 880 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 881 | void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 882 | } |
| 883 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 884 | void DestroyShader(VkDevice device, VkShader shader, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 885 | } |
| 886 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 887 | void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 888 | } |
| 889 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 890 | VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 891 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 892 | return VK_SUCCESS; |
| 893 | } |
| 894 | |
| 895 | VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 896 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 897 | return VK_SUCCESS; |
| 898 | } |
| 899 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 900 | void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 901 | } |
| 902 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 903 | void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 904 | } |
| 905 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 906 | void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 907 | } |
| 908 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 909 | void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 910 | } |
| 911 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 912 | void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 913 | } |
| 914 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 915 | VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 916 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 917 | return VK_SUCCESS; |
| 918 | } |
| 919 | |
Jesse Hall | cf25c41 | 2015-10-29 17:14:50 -0700 | [diff] [blame] | 920 | 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] | 921 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 922 | } |
| 923 | |
| 924 | VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 925 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 926 | return VK_SUCCESS; |
| 927 | } |
| 928 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 929 | void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 930 | } |
| 931 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 932 | void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 933 | } |
| 934 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 935 | void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 936 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 937 | } |
| 938 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 939 | VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 940 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 941 | return VK_SUCCESS; |
| 942 | } |
| 943 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 944 | VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 945 | return VK_SUCCESS; |
| 946 | } |
| 947 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 948 | VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 949 | return VK_SUCCESS; |
| 950 | } |
| 951 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 952 | VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 953 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 954 | return VK_SUCCESS; |
| 955 | } |
| 956 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 957 | void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 958 | } |
| 959 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 960 | void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 961 | } |
| 962 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 963 | void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 964 | } |
| 965 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 966 | void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 967 | } |
| 968 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 969 | void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 970 | } |
| 971 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 972 | void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 973 | } |
| 974 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 975 | void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 976 | } |
| 977 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 978 | void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 979 | } |
| 980 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 981 | void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 982 | } |
| 983 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 984 | void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 985 | } |
| 986 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 987 | 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] | 988 | } |
| 989 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 990 | void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 991 | } |
| 992 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 993 | 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] | 994 | } |
| 995 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 996 | 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] | 997 | } |
| 998 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 999 | 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] | 1000 | } |
| 1001 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1002 | 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] | 1003 | } |
| 1004 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1005 | 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] | 1006 | } |
| 1007 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1008 | 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] | 1009 | } |
| 1010 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1011 | void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1012 | } |
| 1013 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1014 | 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] | 1015 | } |
| 1016 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1017 | 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] | 1018 | } |
| 1019 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1020 | 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] | 1021 | } |
| 1022 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1023 | 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] | 1024 | } |
| 1025 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1026 | 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] | 1027 | } |
| 1028 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1029 | 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] | 1030 | } |
| 1031 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1032 | 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] | 1033 | } |
| 1034 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1035 | 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] | 1036 | } |
| 1037 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1038 | 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] | 1039 | } |
| 1040 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1041 | 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] | 1042 | } |
| 1043 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1044 | 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] | 1045 | } |
| 1046 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1047 | void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1048 | } |
| 1049 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1050 | void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1051 | } |
| 1052 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1053 | void CmdWaitEvents(VkCommandBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1054 | } |
| 1055 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1056 | void CmdPipelineBarrier(VkCommandBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkDependencyFlags dependencyFlags, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1057 | } |
| 1058 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1059 | void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1060 | } |
| 1061 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1062 | void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1063 | } |
| 1064 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1065 | void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1066 | } |
| 1067 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1068 | void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1069 | } |
| 1070 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1071 | 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] | 1072 | } |
| 1073 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1074 | 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] | 1075 | } |
| 1076 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1077 | void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkRenderPassContents contents) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1078 | } |
| 1079 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1080 | void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkRenderPassContents contents) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1081 | } |
| 1082 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1083 | void CmdEndRenderPass(VkCommandBuffer cmdBuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1084 | } |
| 1085 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame^] | 1086 | void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1087 | } |
| 1088 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1089 | #pragma clang diagnostic pop |
| 1090 | // clang-format on |
| 1091 | |
| 1092 | } // namespace null_driver |