Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1 | #include <hardware/hwvulkan.h> |
| 2 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 3 | #include <array> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 4 | #include <string.h> |
| 5 | #include <algorithm> |
| 6 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 7 | // #define LOG_NDEBUG 0 |
| 8 | #include <log/log.h> |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 9 | #include <utils/Errors.h> |
| 10 | |
| 11 | #include "null_driver.h" |
| 12 | |
| 13 | using namespace null_driver; |
| 14 | |
| 15 | struct VkPhysicalDevice_T { |
| 16 | hwvulkan_dispatch_t dispatch; |
| 17 | }; |
| 18 | |
| 19 | struct VkInstance_T { |
| 20 | hwvulkan_dispatch_t dispatch; |
| 21 | const VkAllocCallbacks* alloc; |
| 22 | VkPhysicalDevice_T physical_device; |
| 23 | }; |
| 24 | |
| 25 | struct VkQueue_T { |
| 26 | hwvulkan_dispatch_t dispatch; |
| 27 | }; |
| 28 | |
| 29 | struct VkCmdBuffer_T { |
| 30 | hwvulkan_dispatch_t dispatch; |
| 31 | }; |
| 32 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 33 | namespace { |
| 34 | // Handles for non-dispatchable objects are either pointers, or arbitrary |
| 35 | // 64-bit non-zero values. We only use pointers when we need to keep state for |
| 36 | // the object even in a null driver. For the rest, we form a handle as: |
| 37 | // [63:63] = 1 to distinguish from pointer handles* |
| 38 | // [62:56] = non-zero handle type enum value |
| 39 | // [55: 0] = per-handle-type incrementing counter |
| 40 | // * This works because virtual addresses with the high bit set are reserved |
| 41 | // for kernel data in all ABIs we run on. |
| 42 | // |
| 43 | // We never reclaim handles on vkDestroy*. It's not even necessary for us to |
| 44 | // have distinct handles for live objects, and practically speaking we won't |
| 45 | // ever create 2^56 objects of the same type from a single VkDevice in a null |
| 46 | // driver. |
| 47 | // |
| 48 | // Using a namespace here instead of 'enum class' since we want scoped |
| 49 | // constants but also want implicit conversions to integral types. |
| 50 | namespace HandleType { |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame^] | 51 | enum Enum { |
| 52 | kAttachmentView, |
| 53 | kBufferView, |
| 54 | kCmdPool, |
| 55 | kDescriptorPool, |
| 56 | kDescriptorSet, |
| 57 | kDescriptorSetLayout, |
| 58 | kDynamicColorBlendState, |
| 59 | kDynamicDepthStencilState, |
| 60 | kDynamicRasterState, |
| 61 | kDynamicViewportState, |
| 62 | kEvent, |
| 63 | kFence, |
| 64 | kFramebuffer, |
| 65 | kImageView, |
| 66 | kPipeline, |
| 67 | kPipelineCache, |
| 68 | kPipelineLayout, |
| 69 | kQueryPool, |
| 70 | kRenderPass, |
| 71 | kSampler, |
| 72 | kSemaphore, |
| 73 | kShader, |
| 74 | kShaderModule, |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 75 | |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame^] | 76 | kNumTypes |
| 77 | }; |
| 78 | } // namespace HandleType |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 79 | uint64_t AllocHandle(VkDevice device, HandleType::Enum type); |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame^] | 80 | } // anonymous namespace |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 81 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 82 | struct VkDevice_T { |
| 83 | hwvulkan_dispatch_t dispatch; |
| 84 | VkInstance_T* instance; |
| 85 | VkQueue_T queue; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 86 | std::array<uint64_t, HandleType::kNumTypes> next_handle; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 87 | }; |
| 88 | |
| 89 | // ----------------------------------------------------------------------------- |
| 90 | // Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device |
| 91 | // later. |
| 92 | |
| 93 | namespace { |
| 94 | int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device); |
| 95 | hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice}; |
| 96 | } // namespace |
| 97 | |
| 98 | #pragma clang diagnostic push |
| 99 | #pragma clang diagnostic ignored "-Wmissing-variable-declarations" |
| 100 | __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = { |
| 101 | .common = |
| 102 | { |
| 103 | .tag = HARDWARE_MODULE_TAG, |
| 104 | .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1, |
| 105 | .hal_api_version = HARDWARE_HAL_API_VERSION, |
| 106 | .id = HWVULKAN_HARDWARE_MODULE_ID, |
| 107 | .name = "Null Vulkan Driver", |
| 108 | .author = "The Android Open Source Project", |
| 109 | .methods = &nulldrv_module_methods, |
| 110 | }, |
| 111 | }; |
| 112 | #pragma clang diagnostic pop |
| 113 | |
| 114 | // ----------------------------------------------------------------------------- |
| 115 | |
| 116 | namespace { |
| 117 | |
| 118 | VkResult CreateInstance(const VkInstanceCreateInfo* create_info, |
| 119 | VkInstance* out_instance) { |
| 120 | VkInstance_T* instance = |
| 121 | static_cast<VkInstance_T*>(create_info->pAllocCb->pfnAlloc( |
| 122 | create_info->pAllocCb->pUserData, sizeof(VkInstance_T), |
| 123 | alignof(VkInstance_T), VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 124 | if (!instance) |
| 125 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 126 | |
| 127 | instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 128 | instance->alloc = create_info->pAllocCb; |
| 129 | instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 130 | |
| 131 | *out_instance = instance; |
| 132 | return VK_SUCCESS; |
| 133 | } |
| 134 | |
| 135 | int CloseDevice(struct hw_device_t* /*device*/) { |
| 136 | // nothing to do - opening a device doesn't allocate any resources |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | hwvulkan_device_t nulldrv_device = { |
| 141 | .common = |
| 142 | { |
| 143 | .tag = HARDWARE_DEVICE_TAG, |
| 144 | .version = HWVULKAN_DEVICE_API_VERSION_0_1, |
| 145 | .module = &HAL_MODULE_INFO_SYM.common, |
| 146 | .close = CloseDevice, |
| 147 | }, |
| 148 | .GetGlobalExtensionProperties = GetGlobalExtensionProperties, |
| 149 | .CreateInstance = CreateInstance, |
| 150 | .GetInstanceProcAddr = GetInstanceProcAddr}; |
| 151 | |
| 152 | int OpenDevice(const hw_module_t* /*module*/, |
| 153 | const char* id, |
| 154 | hw_device_t** device) { |
| 155 | if (strcmp(id, HWVULKAN_DEVICE_0) == 0) { |
| 156 | *device = &nulldrv_device.common; |
| 157 | return 0; |
| 158 | } |
| 159 | return -ENOENT; |
| 160 | } |
| 161 | |
| 162 | VkInstance_T* GetInstanceFromPhysicalDevice( |
| 163 | VkPhysicalDevice_T* physical_device) { |
| 164 | return reinterpret_cast<VkInstance_T*>( |
| 165 | reinterpret_cast<uintptr_t>(physical_device) - |
| 166 | offsetof(VkInstance_T, physical_device)); |
| 167 | } |
| 168 | |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 169 | uint64_t AllocHandle(VkDevice device, HandleType::Enum type) { |
| 170 | const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1; |
| 171 | ALOGE_IF(device->next_handle[type] == kHandleMask, |
| 172 | "non-dispatchable handles of type=%u are about to overflow", |
| 173 | type); |
| 174 | return (UINT64_C(1) << 63) | ((uint64_t(type) & 0x7) << 56) | |
| 175 | (device->next_handle[type]++ & kHandleMask); |
| 176 | } |
| 177 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 178 | } // namespace |
| 179 | |
| 180 | namespace null_driver { |
| 181 | |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 182 | template <typename HandleT> |
| 183 | struct HandleTraits {}; |
| 184 | |
| 185 | template <typename HandleT> |
| 186 | typename HandleTraits<HandleT>::PointerType GetObjectFromHandle( |
| 187 | const HandleT& h) { |
| 188 | return reinterpret_cast<typename HandleTraits<HandleT>::PointerType>( |
| 189 | uintptr_t(h.handle)); |
| 190 | } |
| 191 | |
| 192 | template <typename T> |
| 193 | typename T::HandleType GetHandleToObject(const T* obj) { |
| 194 | return typename T::HandleType(reinterpret_cast<uintptr_t>(obj)); |
| 195 | } |
| 196 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 197 | // ----------------------------------------------------------------------------- |
| 198 | // Global |
| 199 | |
| 200 | VkResult GetGlobalExtensionProperties(const char*, |
| 201 | uint32_t* count, |
| 202 | VkExtensionProperties*) { |
| 203 | *count = 0; |
| 204 | return VK_SUCCESS; |
| 205 | } |
| 206 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 207 | PFN_vkVoidFunction GetInstanceProcAddr(VkInstance, const char* name) { |
| 208 | PFN_vkVoidFunction proc = LookupInstanceProcAddr(name); |
| 209 | if (!proc && strcmp(name, "vkGetDeviceProcAddr") == 0) |
| 210 | proc = reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr); |
| 211 | return proc; |
| 212 | } |
| 213 | |
| 214 | PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) { |
| 215 | return LookupDeviceProcAddr(name); |
| 216 | } |
| 217 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 218 | // ----------------------------------------------------------------------------- |
| 219 | // Instance |
| 220 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 221 | VkResult DestroyInstance(VkInstance instance) { |
| 222 | instance->alloc->pfnFree(instance->alloc->pUserData, instance); |
| 223 | return VK_SUCCESS; |
| 224 | } |
| 225 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 226 | // ----------------------------------------------------------------------------- |
| 227 | // PhysicalDevice |
| 228 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 229 | VkResult EnumeratePhysicalDevices(VkInstance instance, |
| 230 | uint32_t* physical_device_count, |
| 231 | VkPhysicalDevice* physical_devices) { |
| 232 | if (physical_devices && *physical_device_count >= 1) |
| 233 | physical_devices[0] = &instance->physical_device; |
| 234 | *physical_device_count = 1; |
| 235 | return VK_SUCCESS; |
| 236 | } |
| 237 | |
| 238 | VkResult GetPhysicalDeviceProperties(VkPhysicalDevice, |
| 239 | VkPhysicalDeviceProperties* properties) { |
| 240 | properties->apiVersion = VK_API_VERSION; |
| 241 | properties->driverVersion = VK_MAKE_VERSION(0, 0, 1); |
| 242 | properties->vendorId = 0xC0DE; |
| 243 | properties->deviceId = 0xCAFE; |
| 244 | properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; |
| 245 | strcpy(properties->deviceName, "Android Vulkan Null Driver"); |
| 246 | memset(properties->pipelineCacheUUID, 0, |
| 247 | sizeof(properties->pipelineCacheUUID)); |
| 248 | return VK_SUCCESS; |
| 249 | } |
| 250 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 251 | VkResult GetPhysicalDeviceMemoryProperties( |
| 252 | VkPhysicalDevice, |
| 253 | VkPhysicalDeviceMemoryProperties* properties) { |
| 254 | properties->memoryTypeCount = 1; |
| 255 | properties->memoryTypes[0].propertyFlags = |
| 256 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; |
| 257 | properties->memoryTypes[0].heapIndex = 0; |
| 258 | properties->memoryHeapCount = 1; |
| 259 | properties->memoryHeaps[0].size = |
| 260 | INTPTR_MAX; // TODO: do something smarter? |
| 261 | properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_HOST_LOCAL; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 262 | return VK_SUCCESS; |
| 263 | } |
| 264 | |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 265 | // ----------------------------------------------------------------------------- |
| 266 | // Device |
| 267 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 268 | VkResult CreateDevice(VkPhysicalDevice physical_device, |
| 269 | const VkDeviceCreateInfo*, |
| 270 | VkDevice* out_device) { |
| 271 | VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device); |
| 272 | VkDevice_T* device = static_cast<VkDevice_T*>(instance->alloc->pfnAlloc( |
| 273 | instance->alloc->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T), |
| 274 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 275 | if (!device) |
| 276 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 277 | |
| 278 | device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 279 | device->instance = instance; |
| 280 | device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 281 | std::fill(device->next_handle.begin(), device->next_handle.end(), |
| 282 | UINT64_C(0)); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 283 | |
| 284 | *out_device = device; |
| 285 | return VK_SUCCESS; |
| 286 | } |
| 287 | |
| 288 | VkResult DestroyDevice(VkDevice device) { |
| 289 | if (!device) |
| 290 | return VK_SUCCESS; |
| 291 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 292 | alloc->pfnFree(alloc->pUserData, device); |
| 293 | return VK_SUCCESS; |
| 294 | } |
| 295 | |
| 296 | VkResult GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) { |
| 297 | *queue = &device->queue; |
| 298 | return VK_SUCCESS; |
| 299 | } |
| 300 | |
| 301 | // ----------------------------------------------------------------------------- |
Jesse Hall | c7a6eb5 | 2015-08-31 12:52:03 -0700 | [diff] [blame^] | 302 | // CmdBuffer |
| 303 | |
| 304 | VkResult CreateCommandBuffer(VkDevice device, |
| 305 | const VkCmdBufferCreateInfo*, |
| 306 | VkCmdBuffer* out_cmdbuf) { |
| 307 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 308 | VkCmdBuffer_T* cmdbuf = static_cast<VkCmdBuffer_T*>(alloc->pfnAlloc( |
| 309 | alloc->pUserData, sizeof(VkCmdBuffer_T), alignof(VkCmdBuffer_T), |
| 310 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 311 | if (!cmdbuf) |
| 312 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 313 | cmdbuf->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 314 | *out_cmdbuf = cmdbuf; |
| 315 | return VK_SUCCESS; |
| 316 | } |
| 317 | |
| 318 | VkResult DestroyCommandBuffer(VkDevice device, VkCmdBuffer cmdbuf) { |
| 319 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 320 | alloc->pfnFree(alloc->pUserData, cmdbuf); |
| 321 | return VK_SUCCESS; |
| 322 | } |
| 323 | |
| 324 | // ----------------------------------------------------------------------------- |
Jesse Hall | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 325 | // DeviceMemory |
| 326 | |
| 327 | struct DeviceMemory { |
| 328 | typedef VkDeviceMemory HandleType; |
| 329 | VkDeviceSize size; |
| 330 | alignas(16) uint8_t data[0]; |
| 331 | }; |
| 332 | template <> |
| 333 | struct HandleTraits<VkDeviceMemory> { |
| 334 | typedef DeviceMemory* PointerType; |
| 335 | }; |
| 336 | |
| 337 | VkResult AllocMemory(VkDevice device, |
| 338 | const VkMemoryAllocInfo* alloc_info, |
| 339 | VkDeviceMemory* mem_handle) { |
| 340 | if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize) |
| 341 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 342 | |
| 343 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 344 | size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize); |
| 345 | DeviceMemory* mem = static_cast<DeviceMemory*>( |
| 346 | alloc->pfnAlloc(alloc->pUserData, size, alignof(DeviceMemory), |
| 347 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 348 | if (!mem) |
| 349 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 350 | mem->size = size; |
| 351 | *mem_handle = GetHandleToObject(mem); |
| 352 | return VK_SUCCESS; |
| 353 | } |
| 354 | |
| 355 | VkResult FreeMemory(VkDevice device, VkDeviceMemory mem_handle) { |
| 356 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 357 | DeviceMemory* mem = GetObjectFromHandle(mem_handle); |
| 358 | alloc->pfnFree(alloc->pUserData, mem); |
| 359 | return VK_SUCCESS; |
| 360 | } |
| 361 | |
| 362 | VkResult MapMemory(VkDevice, |
| 363 | VkDeviceMemory mem_handle, |
| 364 | VkDeviceSize offset, |
| 365 | VkDeviceSize, |
| 366 | VkMemoryMapFlags, |
| 367 | void** out_ptr) { |
| 368 | DeviceMemory* mem = GetObjectFromHandle(mem_handle); |
| 369 | *out_ptr = &mem->data[0] + offset; |
| 370 | return VK_SUCCESS; |
| 371 | } |
| 372 | |
| 373 | // ----------------------------------------------------------------------------- |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 374 | // Buffer |
| 375 | |
| 376 | struct Buffer { |
| 377 | typedef VkBuffer HandleType; |
| 378 | VkDeviceSize size; |
| 379 | }; |
| 380 | template <> |
| 381 | struct HandleTraits<VkBuffer> { |
| 382 | typedef Buffer* PointerType; |
| 383 | }; |
| 384 | |
| 385 | VkResult CreateBuffer(VkDevice device, |
| 386 | const VkBufferCreateInfo* create_info, |
| 387 | VkBuffer* buffer_handle) { |
| 388 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 389 | Buffer* buffer = static_cast<Buffer*>( |
| 390 | alloc->pfnAlloc(alloc->pUserData, sizeof(Buffer), alignof(Buffer), |
| 391 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 392 | if (!buffer) |
| 393 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 394 | buffer->size = create_info->size; |
| 395 | *buffer_handle = GetHandleToObject(buffer); |
| 396 | return VK_SUCCESS; |
| 397 | } |
| 398 | |
| 399 | VkResult GetBufferMemoryRequirements(VkDevice, |
| 400 | VkBuffer buffer_handle, |
| 401 | VkMemoryRequirements* requirements) { |
| 402 | Buffer* buffer = GetObjectFromHandle(buffer_handle); |
| 403 | requirements->size = buffer->size; |
| 404 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 405 | requirements->memoryTypeBits = 0x1; |
| 406 | return VK_SUCCESS; |
| 407 | } |
| 408 | |
| 409 | VkResult DestroyBuffer(VkDevice device, VkBuffer buffer_handle) { |
| 410 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 411 | Buffer* buffer = GetObjectFromHandle(buffer_handle); |
| 412 | alloc->pfnFree(alloc->pUserData, buffer); |
| 413 | return VK_SUCCESS; |
| 414 | } |
| 415 | |
| 416 | // ----------------------------------------------------------------------------- |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame] | 417 | // No-op types |
| 418 | |
| 419 | VkResult CreateAttachmentView(VkDevice device, |
| 420 | const VkAttachmentViewCreateInfo*, |
| 421 | VkAttachmentView* view) { |
| 422 | *view = AllocHandle(device, HandleType::kAttachmentView); |
| 423 | return VK_SUCCESS; |
| 424 | } |
| 425 | |
| 426 | VkResult CreateBufferView(VkDevice device, |
| 427 | const VkBufferViewCreateInfo*, |
| 428 | VkBufferView* view) { |
| 429 | *view = AllocHandle(device, HandleType::kBufferView); |
| 430 | return VK_SUCCESS; |
| 431 | } |
| 432 | |
| 433 | VkResult CreateCommandPool(VkDevice device, |
| 434 | const VkCmdPoolCreateInfo*, |
| 435 | VkCmdPool* pool) { |
| 436 | *pool = AllocHandle(device, HandleType::kCmdPool); |
| 437 | return VK_SUCCESS; |
| 438 | } |
| 439 | |
| 440 | VkResult CreateDescriptorPool(VkDevice device, |
| 441 | VkDescriptorPoolUsage, |
| 442 | uint32_t, |
| 443 | const VkDescriptorPoolCreateInfo*, |
| 444 | VkDescriptorPool* pool) { |
| 445 | *pool = AllocHandle(device, HandleType::kDescriptorPool); |
| 446 | return VK_SUCCESS; |
| 447 | } |
| 448 | |
| 449 | VkResult AllocDescriptorSets(VkDevice device, |
| 450 | VkDescriptorPool, |
| 451 | VkDescriptorSetUsage, |
| 452 | uint32_t count, |
| 453 | const VkDescriptorSetLayout*, |
| 454 | VkDescriptorSet* sets, |
| 455 | uint32_t* out_count) { |
| 456 | for (uint32_t i = 0; i < count; i++) |
| 457 | sets[i] = AllocHandle(device, HandleType::kDescriptorSet); |
| 458 | *out_count = count; |
| 459 | return VK_SUCCESS; |
| 460 | } |
| 461 | |
| 462 | VkResult CreateDescriptorSetLayout(VkDevice device, |
| 463 | const VkDescriptorSetLayoutCreateInfo*, |
| 464 | VkDescriptorSetLayout* layout) { |
| 465 | *layout = AllocHandle(device, HandleType::kDescriptorSetLayout); |
| 466 | return VK_SUCCESS; |
| 467 | } |
| 468 | |
| 469 | VkResult CreateDynamicColorBlendState(VkDevice device, |
| 470 | const VkDynamicColorBlendStateCreateInfo*, |
| 471 | VkDynamicColorBlendState* state) { |
| 472 | *state = AllocHandle(device, HandleType::kDynamicColorBlendState); |
| 473 | return VK_SUCCESS; |
| 474 | } |
| 475 | |
| 476 | VkResult CreateDynamicDepthStencilState( |
| 477 | VkDevice device, |
| 478 | const VkDynamicDepthStencilStateCreateInfo*, |
| 479 | VkDynamicDepthStencilState* state) { |
| 480 | *state = AllocHandle(device, HandleType::kDynamicDepthStencilState); |
| 481 | return VK_SUCCESS; |
| 482 | } |
| 483 | |
| 484 | VkResult CreateDynamicRasterState(VkDevice device, |
| 485 | const VkDynamicRasterStateCreateInfo*, |
| 486 | VkDynamicRasterState* state) { |
| 487 | *state = AllocHandle(device, HandleType::kDynamicRasterState); |
| 488 | return VK_SUCCESS; |
| 489 | } |
| 490 | |
| 491 | VkResult CreateDynamicViewportState(VkDevice device, |
| 492 | const VkDynamicViewportStateCreateInfo*, |
| 493 | VkDynamicViewportState* state) { |
| 494 | *state = AllocHandle(device, HandleType::kDynamicViewportState); |
| 495 | return VK_SUCCESS; |
| 496 | } |
| 497 | |
| 498 | VkResult CreateEvent(VkDevice device, |
| 499 | const VkEventCreateInfo*, |
| 500 | VkEvent* event) { |
| 501 | *event = AllocHandle(device, HandleType::kEvent); |
| 502 | return VK_SUCCESS; |
| 503 | } |
| 504 | |
| 505 | VkResult CreateFence(VkDevice device, |
| 506 | const VkFenceCreateInfo*, |
| 507 | VkFence* fence) { |
| 508 | *fence = AllocHandle(device, HandleType::kFence); |
| 509 | return VK_SUCCESS; |
| 510 | } |
| 511 | |
| 512 | VkResult CreateFramebuffer(VkDevice device, |
| 513 | const VkFramebufferCreateInfo*, |
| 514 | VkFramebuffer* framebuffer) { |
| 515 | *framebuffer = AllocHandle(device, HandleType::kFramebuffer); |
| 516 | return VK_SUCCESS; |
| 517 | } |
| 518 | |
| 519 | VkResult CreateImageView(VkDevice device, |
| 520 | const VkImageViewCreateInfo*, |
| 521 | VkImageView* view) { |
| 522 | *view = AllocHandle(device, HandleType::kImageView); |
| 523 | return VK_SUCCESS; |
| 524 | } |
| 525 | |
| 526 | VkResult CreateGraphicsPipelines(VkDevice device, |
| 527 | VkPipelineCache, |
| 528 | uint32_t count, |
| 529 | const VkGraphicsPipelineCreateInfo*, |
| 530 | VkPipeline* pipelines) { |
| 531 | for (uint32_t i = 0; i < count; i++) |
| 532 | pipelines[i] = AllocHandle(device, HandleType::kPipeline); |
| 533 | return VK_SUCCESS; |
| 534 | } |
| 535 | |
| 536 | VkResult CreateComputePipelines(VkDevice device, |
| 537 | VkPipelineCache, |
| 538 | uint32_t count, |
| 539 | const VkComputePipelineCreateInfo*, |
| 540 | VkPipeline* pipelines) { |
| 541 | for (uint32_t i = 0; i < count; i++) |
| 542 | pipelines[i] = AllocHandle(device, HandleType::kPipeline); |
| 543 | return VK_SUCCESS; |
| 544 | } |
| 545 | |
| 546 | VkResult CreatePipelineCache(VkDevice device, |
| 547 | const VkPipelineCacheCreateInfo*, |
| 548 | VkPipelineCache* cache) { |
| 549 | *cache = AllocHandle(device, HandleType::kPipelineCache); |
| 550 | return VK_SUCCESS; |
| 551 | } |
| 552 | |
| 553 | VkResult CreatePipelineLayout(VkDevice device, |
| 554 | const VkPipelineLayoutCreateInfo*, |
| 555 | VkPipelineLayout* layout) { |
| 556 | *layout = AllocHandle(device, HandleType::kPipelineLayout); |
| 557 | return VK_SUCCESS; |
| 558 | } |
| 559 | |
| 560 | VkResult CreateQueryPool(VkDevice device, |
| 561 | const VkQueryPoolCreateInfo*, |
| 562 | VkQueryPool* pool) { |
| 563 | *pool = AllocHandle(device, HandleType::kQueryPool); |
| 564 | return VK_SUCCESS; |
| 565 | } |
| 566 | |
| 567 | VkResult CreateRenderPass(VkDevice device, |
| 568 | const VkRenderPassCreateInfo*, |
| 569 | VkRenderPass* renderpass) { |
| 570 | *renderpass = AllocHandle(device, HandleType::kRenderPass); |
| 571 | return VK_SUCCESS; |
| 572 | } |
| 573 | |
| 574 | VkResult CreateSampler(VkDevice device, |
| 575 | const VkSamplerCreateInfo*, |
| 576 | VkSampler* sampler) { |
| 577 | *sampler = AllocHandle(device, HandleType::kSampler); |
| 578 | return VK_SUCCESS; |
| 579 | } |
| 580 | |
| 581 | VkResult CreateSemaphore(VkDevice device, |
| 582 | const VkSemaphoreCreateInfo*, |
| 583 | VkSemaphore* semaphore) { |
| 584 | *semaphore = AllocHandle(device, HandleType::kSemaphore); |
| 585 | return VK_SUCCESS; |
| 586 | } |
| 587 | |
| 588 | VkResult CreateShader(VkDevice device, |
| 589 | const VkShaderCreateInfo*, |
| 590 | VkShader* shader) { |
| 591 | *shader = AllocHandle(device, HandleType::kShader); |
| 592 | return VK_SUCCESS; |
| 593 | } |
| 594 | |
| 595 | VkResult CreateShaderModule(VkDevice device, |
| 596 | const VkShaderModuleCreateInfo*, |
| 597 | VkShaderModule* module) { |
| 598 | *module = AllocHandle(device, HandleType::kShaderModule); |
| 599 | return VK_SUCCESS; |
| 600 | } |
| 601 | |
| 602 | // ----------------------------------------------------------------------------- |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 603 | // No-op entrypoints |
| 604 | |
| 605 | // clang-format off |
| 606 | #pragma clang diagnostic push |
| 607 | #pragma clang diagnostic ignored "-Wunused-parameter" |
| 608 | |
| 609 | VkResult GetPhysicalDeviceQueueCount(VkPhysicalDevice physicalDevice, uint32_t* pCount) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 610 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 611 | return VK_SUCCESS; |
| 612 | } |
| 613 | |
| 614 | VkResult GetPhysicalDeviceQueueProperties(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 615 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 616 | return VK_SUCCESS; |
| 617 | } |
| 618 | |
| 619 | VkResult GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 620 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 621 | return VK_SUCCESS; |
| 622 | } |
| 623 | |
| 624 | VkResult GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 625 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 626 | return VK_SUCCESS; |
| 627 | } |
| 628 | |
| 629 | VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 630 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 631 | return VK_SUCCESS; |
| 632 | } |
| 633 | |
| 634 | VkResult GetPhysicalDeviceLimits(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 635 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 636 | return VK_SUCCESS; |
| 637 | } |
| 638 | |
| 639 | VkResult GetGlobalLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 640 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 641 | return VK_SUCCESS; |
| 642 | } |
| 643 | |
| 644 | VkResult GetPhysicalDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 645 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 646 | return VK_SUCCESS; |
| 647 | } |
| 648 | |
| 649 | VkResult GetPhysicalDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 650 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 651 | return VK_SUCCESS; |
| 652 | } |
| 653 | |
| 654 | VkResult QueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence) { |
| 655 | return VK_SUCCESS; |
| 656 | } |
| 657 | |
| 658 | VkResult QueueWaitIdle(VkQueue queue) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 659 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 660 | return VK_SUCCESS; |
| 661 | } |
| 662 | |
| 663 | VkResult DeviceWaitIdle(VkDevice device) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 664 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 665 | return VK_SUCCESS; |
| 666 | } |
| 667 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 668 | VkResult UnmapMemory(VkDevice device, VkDeviceMemory mem) { |
| 669 | return VK_SUCCESS; |
| 670 | } |
| 671 | |
| 672 | VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 673 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 674 | return VK_SUCCESS; |
| 675 | } |
| 676 | |
| 677 | VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 678 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 679 | return VK_SUCCESS; |
| 680 | } |
| 681 | |
| 682 | VkResult GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 683 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 684 | return VK_SUCCESS; |
| 685 | } |
| 686 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 687 | VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 688 | return VK_SUCCESS; |
| 689 | } |
| 690 | |
| 691 | VkResult GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 692 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 693 | return VK_SUCCESS; |
| 694 | } |
| 695 | |
| 696 | VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 697 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 698 | return VK_SUCCESS; |
| 699 | } |
| 700 | |
| 701 | VkResult GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 702 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 703 | return VK_SUCCESS; |
| 704 | } |
| 705 | |
| 706 | VkResult 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] | 707 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 708 | return VK_SUCCESS; |
| 709 | } |
| 710 | |
| 711 | VkResult QueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 712 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 713 | return VK_SUCCESS; |
| 714 | } |
| 715 | |
| 716 | VkResult QueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) { |
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 QueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo) { |
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 | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 726 | VkResult DestroyFence(VkDevice device, VkFence fence) { |
| 727 | return VK_SUCCESS; |
| 728 | } |
| 729 | |
| 730 | VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) { |
| 731 | return VK_SUCCESS; |
| 732 | } |
| 733 | |
| 734 | VkResult GetFenceStatus(VkDevice device, VkFence fence) { |
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 | |
| 739 | VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) { |
| 740 | return VK_SUCCESS; |
| 741 | } |
| 742 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 743 | VkResult DestroySemaphore(VkDevice device, VkSemaphore semaphore) { |
| 744 | return VK_SUCCESS; |
| 745 | } |
| 746 | |
| 747 | VkResult QueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore) { |
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 | return VK_SUCCESS; |
| 750 | } |
| 751 | |
| 752 | VkResult QueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 753 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 754 | return VK_SUCCESS; |
| 755 | } |
| 756 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 757 | VkResult DestroyEvent(VkDevice device, VkEvent event) { |
| 758 | return VK_SUCCESS; |
| 759 | } |
| 760 | |
| 761 | VkResult GetEventStatus(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 762 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 763 | return VK_SUCCESS; |
| 764 | } |
| 765 | |
| 766 | VkResult SetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 767 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 768 | return VK_SUCCESS; |
| 769 | } |
| 770 | |
| 771 | VkResult ResetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 772 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 773 | return VK_SUCCESS; |
| 774 | } |
| 775 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 776 | VkResult DestroyQueryPool(VkDevice device, VkQueryPool queryPool) { |
| 777 | return VK_SUCCESS; |
| 778 | } |
| 779 | |
| 780 | 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] | 781 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 782 | return VK_SUCCESS; |
| 783 | } |
| 784 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 785 | VkResult DestroyBufferView(VkDevice device, VkBufferView bufferView) { |
| 786 | return VK_SUCCESS; |
| 787 | } |
| 788 | |
| 789 | VkResult CreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 790 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 791 | return VK_SUCCESS; |
| 792 | } |
| 793 | |
| 794 | VkResult DestroyImage(VkDevice device, VkImage image) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 795 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 796 | return VK_SUCCESS; |
| 797 | } |
| 798 | |
| 799 | VkResult GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 800 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 801 | return VK_SUCCESS; |
| 802 | } |
| 803 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 804 | VkResult DestroyImageView(VkDevice device, VkImageView imageView) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 805 | return VK_SUCCESS; |
| 806 | } |
| 807 | |
| 808 | VkResult DestroyAttachmentView(VkDevice device, VkAttachmentView attachmentView) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 809 | return VK_SUCCESS; |
| 810 | } |
| 811 | |
| 812 | VkResult DestroyShaderModule(VkDevice device, VkShaderModule shaderModule) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 813 | return VK_SUCCESS; |
| 814 | } |
| 815 | |
| 816 | VkResult DestroyShader(VkDevice device, VkShader shader) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 817 | return VK_SUCCESS; |
| 818 | } |
| 819 | |
| 820 | VkResult DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) { |
| 821 | return VK_SUCCESS; |
| 822 | } |
| 823 | |
| 824 | size_t GetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 825 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 826 | return VK_SUCCESS; |
| 827 | } |
| 828 | |
| 829 | VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 830 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 831 | return VK_SUCCESS; |
| 832 | } |
| 833 | |
| 834 | VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 835 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 836 | return VK_SUCCESS; |
| 837 | } |
| 838 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 839 | VkResult DestroyPipeline(VkDevice device, VkPipeline pipeline) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 840 | return VK_SUCCESS; |
| 841 | } |
| 842 | |
| 843 | VkResult DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 844 | return VK_SUCCESS; |
| 845 | } |
| 846 | |
| 847 | VkResult DestroySampler(VkDevice device, VkSampler sampler) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 848 | return VK_SUCCESS; |
| 849 | } |
| 850 | |
| 851 | VkResult DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 852 | return VK_SUCCESS; |
| 853 | } |
| 854 | |
| 855 | VkResult DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) { |
| 856 | return VK_SUCCESS; |
| 857 | } |
| 858 | |
| 859 | VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 860 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 861 | return VK_SUCCESS; |
| 862 | } |
| 863 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 864 | VkResult 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] | 865 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 866 | return VK_SUCCESS; |
| 867 | } |
| 868 | |
| 869 | VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 870 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 871 | return VK_SUCCESS; |
| 872 | } |
| 873 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 874 | VkResult DestroyDynamicViewportState(VkDevice device, VkDynamicViewportState dynamicViewportState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 875 | return VK_SUCCESS; |
| 876 | } |
| 877 | |
| 878 | VkResult DestroyDynamicRasterState(VkDevice device, VkDynamicRasterState dynamicRasterState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 879 | return VK_SUCCESS; |
| 880 | } |
| 881 | |
| 882 | VkResult DestroyDynamicColorBlendState(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 883 | return VK_SUCCESS; |
| 884 | } |
| 885 | |
| 886 | VkResult DestroyDynamicDepthStencilState(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 887 | return VK_SUCCESS; |
| 888 | } |
| 889 | |
| 890 | VkResult DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 891 | return VK_SUCCESS; |
| 892 | } |
| 893 | |
| 894 | VkResult DestroyRenderPass(VkDevice device, VkRenderPass renderPass) { |
| 895 | return VK_SUCCESS; |
| 896 | } |
| 897 | |
| 898 | VkResult GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 899 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 900 | return VK_SUCCESS; |
| 901 | } |
| 902 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 903 | VkResult DestroyCommandPool(VkDevice device, VkCmdPool cmdPool) { |
| 904 | return VK_SUCCESS; |
| 905 | } |
| 906 | |
| 907 | VkResult ResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 908 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 909 | return VK_SUCCESS; |
| 910 | } |
| 911 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 912 | VkResult BeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo) { |
| 913 | return VK_SUCCESS; |
| 914 | } |
| 915 | |
| 916 | VkResult EndCommandBuffer(VkCmdBuffer cmdBuffer) { |
| 917 | return VK_SUCCESS; |
| 918 | } |
| 919 | |
| 920 | VkResult ResetCommandBuffer(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags) { |
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 | return VK_SUCCESS; |
| 923 | } |
| 924 | |
| 925 | void CmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
| 926 | } |
| 927 | |
| 928 | void CmdBindDynamicViewportState(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState) { |
| 929 | } |
| 930 | |
| 931 | void CmdBindDynamicRasterState(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState) { |
| 932 | } |
| 933 | |
| 934 | void CmdBindDynamicColorBlendState(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState) { |
| 935 | } |
| 936 | |
| 937 | void CmdBindDynamicDepthStencilState(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState) { |
| 938 | } |
| 939 | |
| 940 | void CmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { |
| 941 | } |
| 942 | |
| 943 | void CmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
| 944 | } |
| 945 | |
| 946 | void CmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) { |
| 947 | } |
| 948 | |
| 949 | void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) { |
| 950 | } |
| 951 | |
| 952 | void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) { |
| 953 | } |
| 954 | |
| 955 | void CmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
| 956 | } |
| 957 | |
| 958 | void CmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
| 959 | } |
| 960 | |
| 961 | void CmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) { |
| 962 | } |
| 963 | |
| 964 | void CmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) { |
| 965 | } |
| 966 | |
| 967 | void CmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) { |
| 968 | } |
| 969 | |
| 970 | void CmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) { |
| 971 | } |
| 972 | |
| 973 | void CmdBlitImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkTexFilter filter) { |
| 974 | } |
| 975 | |
| 976 | void CmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
| 977 | } |
| 978 | |
| 979 | void CmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
| 980 | } |
| 981 | |
| 982 | void CmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) { |
| 983 | } |
| 984 | |
| 985 | void CmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) { |
| 986 | } |
| 987 | |
| 988 | void CmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
| 989 | } |
| 990 | |
| 991 | void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
| 992 | } |
| 993 | |
| 994 | void CmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects) { |
| 995 | } |
| 996 | |
| 997 | void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects) { |
| 998 | } |
| 999 | |
| 1000 | void CmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) { |
| 1001 | } |
| 1002 | |
| 1003 | void CmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
| 1004 | } |
| 1005 | |
| 1006 | void CmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
| 1007 | } |
| 1008 | |
| 1009 | void CmdWaitEvents(VkCmdBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
| 1010 | } |
| 1011 | |
| 1012 | void CmdPipelineBarrier(VkCmdBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkBool32 byRegion, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
| 1013 | } |
| 1014 | |
| 1015 | void CmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
| 1016 | } |
| 1017 | |
| 1018 | void CmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) { |
| 1019 | } |
| 1020 | |
| 1021 | void CmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) { |
| 1022 | } |
| 1023 | |
| 1024 | void CmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset) { |
| 1025 | } |
| 1026 | |
| 1027 | void CmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags) { |
| 1028 | } |
| 1029 | |
| 1030 | void CmdPushConstants(VkCmdBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) { |
| 1031 | } |
| 1032 | |
| 1033 | void CmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkRenderPassContents contents) { |
| 1034 | } |
| 1035 | |
| 1036 | void CmdNextSubpass(VkCmdBuffer cmdBuffer, VkRenderPassContents contents) { |
| 1037 | } |
| 1038 | |
| 1039 | void CmdEndRenderPass(VkCmdBuffer cmdBuffer) { |
| 1040 | } |
| 1041 | |
| 1042 | void CmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers) { |
| 1043 | } |
| 1044 | |
| 1045 | #pragma clang diagnostic pop |
| 1046 | // clang-format on |
| 1047 | |
| 1048 | } // namespace null_driver |