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