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 { |
| 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, |
| 75 | |
| 76 | kNumTypes |
| 77 | }; |
| 78 | } // namespace HandleType |
| 79 | uint64_t AllocHandle(VkDevice device, HandleType::Enum type); |
| 80 | } // anonymous namespace |
| 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 | 2077ce0 | 2015-08-29 18:10:59 +0100 | [diff] [blame] | 302 | // DeviceMemory |
| 303 | |
| 304 | struct DeviceMemory { |
| 305 | typedef VkDeviceMemory HandleType; |
| 306 | VkDeviceSize size; |
| 307 | alignas(16) uint8_t data[0]; |
| 308 | }; |
| 309 | template <> |
| 310 | struct HandleTraits<VkDeviceMemory> { |
| 311 | typedef DeviceMemory* PointerType; |
| 312 | }; |
| 313 | |
| 314 | VkResult AllocMemory(VkDevice device, |
| 315 | const VkMemoryAllocInfo* alloc_info, |
| 316 | VkDeviceMemory* mem_handle) { |
| 317 | if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize) |
| 318 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 319 | |
| 320 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 321 | size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize); |
| 322 | DeviceMemory* mem = static_cast<DeviceMemory*>( |
| 323 | alloc->pfnAlloc(alloc->pUserData, size, alignof(DeviceMemory), |
| 324 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 325 | if (!mem) |
| 326 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 327 | mem->size = size; |
| 328 | *mem_handle = GetHandleToObject(mem); |
| 329 | return VK_SUCCESS; |
| 330 | } |
| 331 | |
| 332 | VkResult FreeMemory(VkDevice device, VkDeviceMemory mem_handle) { |
| 333 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 334 | DeviceMemory* mem = GetObjectFromHandle(mem_handle); |
| 335 | alloc->pfnFree(alloc->pUserData, mem); |
| 336 | return VK_SUCCESS; |
| 337 | } |
| 338 | |
| 339 | VkResult MapMemory(VkDevice, |
| 340 | VkDeviceMemory mem_handle, |
| 341 | VkDeviceSize offset, |
| 342 | VkDeviceSize, |
| 343 | VkMemoryMapFlags, |
| 344 | void** out_ptr) { |
| 345 | DeviceMemory* mem = GetObjectFromHandle(mem_handle); |
| 346 | *out_ptr = &mem->data[0] + offset; |
| 347 | return VK_SUCCESS; |
| 348 | } |
| 349 | |
| 350 | // ----------------------------------------------------------------------------- |
Jesse Hall | f657874 | 2015-08-29 17:06:12 +0100 | [diff] [blame] | 351 | // Buffer |
| 352 | |
| 353 | struct Buffer { |
| 354 | typedef VkBuffer HandleType; |
| 355 | VkDeviceSize size; |
| 356 | }; |
| 357 | template <> |
| 358 | struct HandleTraits<VkBuffer> { |
| 359 | typedef Buffer* PointerType; |
| 360 | }; |
| 361 | |
| 362 | VkResult CreateBuffer(VkDevice device, |
| 363 | const VkBufferCreateInfo* create_info, |
| 364 | VkBuffer* buffer_handle) { |
| 365 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 366 | Buffer* buffer = static_cast<Buffer*>( |
| 367 | alloc->pfnAlloc(alloc->pUserData, sizeof(Buffer), alignof(Buffer), |
| 368 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 369 | if (!buffer) |
| 370 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 371 | buffer->size = create_info->size; |
| 372 | *buffer_handle = GetHandleToObject(buffer); |
| 373 | return VK_SUCCESS; |
| 374 | } |
| 375 | |
| 376 | VkResult GetBufferMemoryRequirements(VkDevice, |
| 377 | VkBuffer buffer_handle, |
| 378 | VkMemoryRequirements* requirements) { |
| 379 | Buffer* buffer = GetObjectFromHandle(buffer_handle); |
| 380 | requirements->size = buffer->size; |
| 381 | requirements->alignment = 16; // allow fast Neon/SSE memcpy |
| 382 | requirements->memoryTypeBits = 0x1; |
| 383 | return VK_SUCCESS; |
| 384 | } |
| 385 | |
| 386 | VkResult DestroyBuffer(VkDevice device, VkBuffer buffer_handle) { |
| 387 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 388 | Buffer* buffer = GetObjectFromHandle(buffer_handle); |
| 389 | alloc->pfnFree(alloc->pUserData, buffer); |
| 390 | return VK_SUCCESS; |
| 391 | } |
| 392 | |
| 393 | // ----------------------------------------------------------------------------- |
Jesse Hall | f8faf0c | 2015-08-31 11:34:32 -0700 | [diff] [blame^] | 394 | // No-op types |
| 395 | |
| 396 | VkResult CreateAttachmentView(VkDevice device, |
| 397 | const VkAttachmentViewCreateInfo*, |
| 398 | VkAttachmentView* view) { |
| 399 | *view = AllocHandle(device, HandleType::kAttachmentView); |
| 400 | return VK_SUCCESS; |
| 401 | } |
| 402 | |
| 403 | VkResult CreateBufferView(VkDevice device, |
| 404 | const VkBufferViewCreateInfo*, |
| 405 | VkBufferView* view) { |
| 406 | *view = AllocHandle(device, HandleType::kBufferView); |
| 407 | return VK_SUCCESS; |
| 408 | } |
| 409 | |
| 410 | VkResult CreateCommandPool(VkDevice device, |
| 411 | const VkCmdPoolCreateInfo*, |
| 412 | VkCmdPool* pool) { |
| 413 | *pool = AllocHandle(device, HandleType::kCmdPool); |
| 414 | return VK_SUCCESS; |
| 415 | } |
| 416 | |
| 417 | VkResult CreateDescriptorPool(VkDevice device, |
| 418 | VkDescriptorPoolUsage, |
| 419 | uint32_t, |
| 420 | const VkDescriptorPoolCreateInfo*, |
| 421 | VkDescriptorPool* pool) { |
| 422 | *pool = AllocHandle(device, HandleType::kDescriptorPool); |
| 423 | return VK_SUCCESS; |
| 424 | } |
| 425 | |
| 426 | VkResult AllocDescriptorSets(VkDevice device, |
| 427 | VkDescriptorPool, |
| 428 | VkDescriptorSetUsage, |
| 429 | uint32_t count, |
| 430 | const VkDescriptorSetLayout*, |
| 431 | VkDescriptorSet* sets, |
| 432 | uint32_t* out_count) { |
| 433 | for (uint32_t i = 0; i < count; i++) |
| 434 | sets[i] = AllocHandle(device, HandleType::kDescriptorSet); |
| 435 | *out_count = count; |
| 436 | return VK_SUCCESS; |
| 437 | } |
| 438 | |
| 439 | VkResult CreateDescriptorSetLayout(VkDevice device, |
| 440 | const VkDescriptorSetLayoutCreateInfo*, |
| 441 | VkDescriptorSetLayout* layout) { |
| 442 | *layout = AllocHandle(device, HandleType::kDescriptorSetLayout); |
| 443 | return VK_SUCCESS; |
| 444 | } |
| 445 | |
| 446 | VkResult CreateDynamicColorBlendState(VkDevice device, |
| 447 | const VkDynamicColorBlendStateCreateInfo*, |
| 448 | VkDynamicColorBlendState* state) { |
| 449 | *state = AllocHandle(device, HandleType::kDynamicColorBlendState); |
| 450 | return VK_SUCCESS; |
| 451 | } |
| 452 | |
| 453 | VkResult CreateDynamicDepthStencilState( |
| 454 | VkDevice device, |
| 455 | const VkDynamicDepthStencilStateCreateInfo*, |
| 456 | VkDynamicDepthStencilState* state) { |
| 457 | *state = AllocHandle(device, HandleType::kDynamicDepthStencilState); |
| 458 | return VK_SUCCESS; |
| 459 | } |
| 460 | |
| 461 | VkResult CreateDynamicRasterState(VkDevice device, |
| 462 | const VkDynamicRasterStateCreateInfo*, |
| 463 | VkDynamicRasterState* state) { |
| 464 | *state = AllocHandle(device, HandleType::kDynamicRasterState); |
| 465 | return VK_SUCCESS; |
| 466 | } |
| 467 | |
| 468 | VkResult CreateDynamicViewportState(VkDevice device, |
| 469 | const VkDynamicViewportStateCreateInfo*, |
| 470 | VkDynamicViewportState* state) { |
| 471 | *state = AllocHandle(device, HandleType::kDynamicViewportState); |
| 472 | return VK_SUCCESS; |
| 473 | } |
| 474 | |
| 475 | VkResult CreateEvent(VkDevice device, |
| 476 | const VkEventCreateInfo*, |
| 477 | VkEvent* event) { |
| 478 | *event = AllocHandle(device, HandleType::kEvent); |
| 479 | return VK_SUCCESS; |
| 480 | } |
| 481 | |
| 482 | VkResult CreateFence(VkDevice device, |
| 483 | const VkFenceCreateInfo*, |
| 484 | VkFence* fence) { |
| 485 | *fence = AllocHandle(device, HandleType::kFence); |
| 486 | return VK_SUCCESS; |
| 487 | } |
| 488 | |
| 489 | VkResult CreateFramebuffer(VkDevice device, |
| 490 | const VkFramebufferCreateInfo*, |
| 491 | VkFramebuffer* framebuffer) { |
| 492 | *framebuffer = AllocHandle(device, HandleType::kFramebuffer); |
| 493 | return VK_SUCCESS; |
| 494 | } |
| 495 | |
| 496 | VkResult CreateImageView(VkDevice device, |
| 497 | const VkImageViewCreateInfo*, |
| 498 | VkImageView* view) { |
| 499 | *view = AllocHandle(device, HandleType::kImageView); |
| 500 | return VK_SUCCESS; |
| 501 | } |
| 502 | |
| 503 | VkResult CreateGraphicsPipelines(VkDevice device, |
| 504 | VkPipelineCache, |
| 505 | uint32_t count, |
| 506 | const VkGraphicsPipelineCreateInfo*, |
| 507 | VkPipeline* pipelines) { |
| 508 | for (uint32_t i = 0; i < count; i++) |
| 509 | pipelines[i] = AllocHandle(device, HandleType::kPipeline); |
| 510 | return VK_SUCCESS; |
| 511 | } |
| 512 | |
| 513 | VkResult CreateComputePipelines(VkDevice device, |
| 514 | VkPipelineCache, |
| 515 | uint32_t count, |
| 516 | const VkComputePipelineCreateInfo*, |
| 517 | VkPipeline* pipelines) { |
| 518 | for (uint32_t i = 0; i < count; i++) |
| 519 | pipelines[i] = AllocHandle(device, HandleType::kPipeline); |
| 520 | return VK_SUCCESS; |
| 521 | } |
| 522 | |
| 523 | VkResult CreatePipelineCache(VkDevice device, |
| 524 | const VkPipelineCacheCreateInfo*, |
| 525 | VkPipelineCache* cache) { |
| 526 | *cache = AllocHandle(device, HandleType::kPipelineCache); |
| 527 | return VK_SUCCESS; |
| 528 | } |
| 529 | |
| 530 | VkResult CreatePipelineLayout(VkDevice device, |
| 531 | const VkPipelineLayoutCreateInfo*, |
| 532 | VkPipelineLayout* layout) { |
| 533 | *layout = AllocHandle(device, HandleType::kPipelineLayout); |
| 534 | return VK_SUCCESS; |
| 535 | } |
| 536 | |
| 537 | VkResult CreateQueryPool(VkDevice device, |
| 538 | const VkQueryPoolCreateInfo*, |
| 539 | VkQueryPool* pool) { |
| 540 | *pool = AllocHandle(device, HandleType::kQueryPool); |
| 541 | return VK_SUCCESS; |
| 542 | } |
| 543 | |
| 544 | VkResult CreateRenderPass(VkDevice device, |
| 545 | const VkRenderPassCreateInfo*, |
| 546 | VkRenderPass* renderpass) { |
| 547 | *renderpass = AllocHandle(device, HandleType::kRenderPass); |
| 548 | return VK_SUCCESS; |
| 549 | } |
| 550 | |
| 551 | VkResult CreateSampler(VkDevice device, |
| 552 | const VkSamplerCreateInfo*, |
| 553 | VkSampler* sampler) { |
| 554 | *sampler = AllocHandle(device, HandleType::kSampler); |
| 555 | return VK_SUCCESS; |
| 556 | } |
| 557 | |
| 558 | VkResult CreateSemaphore(VkDevice device, |
| 559 | const VkSemaphoreCreateInfo*, |
| 560 | VkSemaphore* semaphore) { |
| 561 | *semaphore = AllocHandle(device, HandleType::kSemaphore); |
| 562 | return VK_SUCCESS; |
| 563 | } |
| 564 | |
| 565 | VkResult CreateShader(VkDevice device, |
| 566 | const VkShaderCreateInfo*, |
| 567 | VkShader* shader) { |
| 568 | *shader = AllocHandle(device, HandleType::kShader); |
| 569 | return VK_SUCCESS; |
| 570 | } |
| 571 | |
| 572 | VkResult CreateShaderModule(VkDevice device, |
| 573 | const VkShaderModuleCreateInfo*, |
| 574 | VkShaderModule* module) { |
| 575 | *module = AllocHandle(device, HandleType::kShaderModule); |
| 576 | return VK_SUCCESS; |
| 577 | } |
| 578 | |
| 579 | // ----------------------------------------------------------------------------- |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 580 | // No-op entrypoints |
| 581 | |
| 582 | // clang-format off |
| 583 | #pragma clang diagnostic push |
| 584 | #pragma clang diagnostic ignored "-Wunused-parameter" |
| 585 | |
| 586 | VkResult GetPhysicalDeviceQueueCount(VkPhysicalDevice physicalDevice, uint32_t* pCount) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 587 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 588 | return VK_SUCCESS; |
| 589 | } |
| 590 | |
| 591 | VkResult GetPhysicalDeviceQueueProperties(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 592 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 593 | return VK_SUCCESS; |
| 594 | } |
| 595 | |
| 596 | VkResult GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 597 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 598 | return VK_SUCCESS; |
| 599 | } |
| 600 | |
| 601 | VkResult GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 602 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 603 | return VK_SUCCESS; |
| 604 | } |
| 605 | |
| 606 | 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] | 607 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 608 | return VK_SUCCESS; |
| 609 | } |
| 610 | |
| 611 | VkResult GetPhysicalDeviceLimits(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 612 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 613 | return VK_SUCCESS; |
| 614 | } |
| 615 | |
| 616 | VkResult GetGlobalLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 617 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 618 | return VK_SUCCESS; |
| 619 | } |
| 620 | |
| 621 | VkResult GetPhysicalDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 622 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 623 | return VK_SUCCESS; |
| 624 | } |
| 625 | |
| 626 | VkResult GetPhysicalDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 627 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 628 | return VK_SUCCESS; |
| 629 | } |
| 630 | |
| 631 | VkResult QueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 632 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 633 | return VK_SUCCESS; |
| 634 | } |
| 635 | |
| 636 | VkResult QueueWaitIdle(VkQueue queue) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 637 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 638 | return VK_SUCCESS; |
| 639 | } |
| 640 | |
| 641 | VkResult DeviceWaitIdle(VkDevice device) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 642 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 643 | return VK_SUCCESS; |
| 644 | } |
| 645 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 646 | VkResult UnmapMemory(VkDevice device, VkDeviceMemory mem) { |
| 647 | return VK_SUCCESS; |
| 648 | } |
| 649 | |
| 650 | VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 651 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 652 | return VK_SUCCESS; |
| 653 | } |
| 654 | |
| 655 | VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 656 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 657 | return VK_SUCCESS; |
| 658 | } |
| 659 | |
| 660 | VkResult GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 661 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 662 | return VK_SUCCESS; |
| 663 | } |
| 664 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 665 | VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 666 | return VK_SUCCESS; |
| 667 | } |
| 668 | |
| 669 | VkResult GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 670 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 671 | return VK_SUCCESS; |
| 672 | } |
| 673 | |
| 674 | VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 675 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 676 | return VK_SUCCESS; |
| 677 | } |
| 678 | |
| 679 | VkResult GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 680 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 681 | return VK_SUCCESS; |
| 682 | } |
| 683 | |
| 684 | 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] | 685 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 686 | return VK_SUCCESS; |
| 687 | } |
| 688 | |
| 689 | VkResult QueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) { |
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 | return VK_SUCCESS; |
| 692 | } |
| 693 | |
| 694 | VkResult QueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 695 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 696 | return VK_SUCCESS; |
| 697 | } |
| 698 | |
| 699 | VkResult QueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 700 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 701 | return VK_SUCCESS; |
| 702 | } |
| 703 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 704 | VkResult DestroyFence(VkDevice device, VkFence fence) { |
| 705 | return VK_SUCCESS; |
| 706 | } |
| 707 | |
| 708 | VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 709 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 710 | return VK_SUCCESS; |
| 711 | } |
| 712 | |
| 713 | VkResult GetFenceStatus(VkDevice device, VkFence fence) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 714 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 715 | return VK_SUCCESS; |
| 716 | } |
| 717 | |
| 718 | VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 719 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 720 | return VK_SUCCESS; |
| 721 | } |
| 722 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 723 | VkResult DestroySemaphore(VkDevice device, VkSemaphore semaphore) { |
| 724 | return VK_SUCCESS; |
| 725 | } |
| 726 | |
| 727 | VkResult QueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 728 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 729 | return VK_SUCCESS; |
| 730 | } |
| 731 | |
| 732 | VkResult QueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 733 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 734 | return VK_SUCCESS; |
| 735 | } |
| 736 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 737 | VkResult DestroyEvent(VkDevice device, VkEvent event) { |
| 738 | return VK_SUCCESS; |
| 739 | } |
| 740 | |
| 741 | VkResult GetEventStatus(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 742 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 743 | return VK_SUCCESS; |
| 744 | } |
| 745 | |
| 746 | VkResult SetEvent(VkDevice device, VkEvent event) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 747 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 748 | return VK_SUCCESS; |
| 749 | } |
| 750 | |
| 751 | VkResult ResetEvent(VkDevice device, VkEvent event) { |
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 | return VK_SUCCESS; |
| 754 | } |
| 755 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 756 | VkResult DestroyQueryPool(VkDevice device, VkQueryPool queryPool) { |
| 757 | return VK_SUCCESS; |
| 758 | } |
| 759 | |
| 760 | 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] | 761 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 762 | return VK_SUCCESS; |
| 763 | } |
| 764 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 765 | VkResult DestroyBufferView(VkDevice device, VkBufferView bufferView) { |
| 766 | return VK_SUCCESS; |
| 767 | } |
| 768 | |
| 769 | VkResult CreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage) { |
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 | |
| 774 | VkResult DestroyImage(VkDevice device, VkImage image) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 775 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 776 | return VK_SUCCESS; |
| 777 | } |
| 778 | |
| 779 | VkResult GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 780 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 781 | return VK_SUCCESS; |
| 782 | } |
| 783 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 784 | VkResult DestroyImageView(VkDevice device, VkImageView imageView) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 785 | return VK_SUCCESS; |
| 786 | } |
| 787 | |
| 788 | VkResult DestroyAttachmentView(VkDevice device, VkAttachmentView attachmentView) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 789 | return VK_SUCCESS; |
| 790 | } |
| 791 | |
| 792 | VkResult DestroyShaderModule(VkDevice device, VkShaderModule shaderModule) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 793 | return VK_SUCCESS; |
| 794 | } |
| 795 | |
| 796 | VkResult DestroyShader(VkDevice device, VkShader shader) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 797 | return VK_SUCCESS; |
| 798 | } |
| 799 | |
| 800 | VkResult DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) { |
| 801 | return VK_SUCCESS; |
| 802 | } |
| 803 | |
| 804 | size_t GetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 805 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 806 | return VK_SUCCESS; |
| 807 | } |
| 808 | |
| 809 | VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 810 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 811 | return VK_SUCCESS; |
| 812 | } |
| 813 | |
| 814 | VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 815 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 816 | return VK_SUCCESS; |
| 817 | } |
| 818 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 819 | VkResult DestroyPipeline(VkDevice device, VkPipeline pipeline) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 820 | return VK_SUCCESS; |
| 821 | } |
| 822 | |
| 823 | VkResult DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 824 | return VK_SUCCESS; |
| 825 | } |
| 826 | |
| 827 | VkResult DestroySampler(VkDevice device, VkSampler sampler) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 828 | return VK_SUCCESS; |
| 829 | } |
| 830 | |
| 831 | VkResult DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 832 | return VK_SUCCESS; |
| 833 | } |
| 834 | |
| 835 | VkResult DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) { |
| 836 | return VK_SUCCESS; |
| 837 | } |
| 838 | |
| 839 | VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 840 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 841 | return VK_SUCCESS; |
| 842 | } |
| 843 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 844 | 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] | 845 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 846 | return VK_SUCCESS; |
| 847 | } |
| 848 | |
| 849 | VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 850 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 851 | return VK_SUCCESS; |
| 852 | } |
| 853 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 854 | VkResult DestroyDynamicViewportState(VkDevice device, VkDynamicViewportState dynamicViewportState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 855 | return VK_SUCCESS; |
| 856 | } |
| 857 | |
| 858 | VkResult DestroyDynamicRasterState(VkDevice device, VkDynamicRasterState dynamicRasterState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 859 | return VK_SUCCESS; |
| 860 | } |
| 861 | |
| 862 | VkResult DestroyDynamicColorBlendState(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 863 | return VK_SUCCESS; |
| 864 | } |
| 865 | |
| 866 | VkResult DestroyDynamicDepthStencilState(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 867 | return VK_SUCCESS; |
| 868 | } |
| 869 | |
| 870 | VkResult DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) { |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 871 | return VK_SUCCESS; |
| 872 | } |
| 873 | |
| 874 | VkResult DestroyRenderPass(VkDevice device, VkRenderPass renderPass) { |
| 875 | return VK_SUCCESS; |
| 876 | } |
| 877 | |
| 878 | VkResult GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 879 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 880 | return VK_SUCCESS; |
| 881 | } |
| 882 | |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 883 | VkResult DestroyCommandPool(VkDevice device, VkCmdPool cmdPool) { |
| 884 | return VK_SUCCESS; |
| 885 | } |
| 886 | |
| 887 | VkResult ResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 888 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 889 | return VK_SUCCESS; |
| 890 | } |
| 891 | |
| 892 | VkResult CreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 893 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 894 | return VK_SUCCESS; |
| 895 | } |
| 896 | |
| 897 | VkResult DestroyCommandBuffer(VkDevice device, VkCmdBuffer commandBuffer) { |
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 | return VK_SUCCESS; |
| 900 | } |
| 901 | |
| 902 | VkResult BeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 903 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 904 | return VK_SUCCESS; |
| 905 | } |
| 906 | |
| 907 | VkResult EndCommandBuffer(VkCmdBuffer cmdBuffer) { |
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 | |
| 912 | VkResult ResetCommandBuffer(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags) { |
Jesse Hall | 73ab0ac | 2015-08-25 15:09:15 +0100 | [diff] [blame] | 913 | ALOGV("TODO: vk%s", __FUNCTION__); |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 914 | return VK_SUCCESS; |
| 915 | } |
| 916 | |
| 917 | void CmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
| 918 | } |
| 919 | |
| 920 | void CmdBindDynamicViewportState(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState) { |
| 921 | } |
| 922 | |
| 923 | void CmdBindDynamicRasterState(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState) { |
| 924 | } |
| 925 | |
| 926 | void CmdBindDynamicColorBlendState(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState) { |
| 927 | } |
| 928 | |
| 929 | void CmdBindDynamicDepthStencilState(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState) { |
| 930 | } |
| 931 | |
| 932 | void CmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { |
| 933 | } |
| 934 | |
| 935 | void CmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
| 936 | } |
| 937 | |
| 938 | void CmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) { |
| 939 | } |
| 940 | |
| 941 | void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) { |
| 942 | } |
| 943 | |
| 944 | void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) { |
| 945 | } |
| 946 | |
| 947 | void CmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
| 948 | } |
| 949 | |
| 950 | void CmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
| 951 | } |
| 952 | |
| 953 | void CmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) { |
| 954 | } |
| 955 | |
| 956 | void CmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) { |
| 957 | } |
| 958 | |
| 959 | void CmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) { |
| 960 | } |
| 961 | |
| 962 | void CmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) { |
| 963 | } |
| 964 | |
| 965 | void CmdBlitImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkTexFilter filter) { |
| 966 | } |
| 967 | |
| 968 | void CmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
| 969 | } |
| 970 | |
| 971 | void CmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
| 972 | } |
| 973 | |
| 974 | void CmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) { |
| 975 | } |
| 976 | |
| 977 | void CmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) { |
| 978 | } |
| 979 | |
| 980 | void CmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
| 981 | } |
| 982 | |
| 983 | void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
| 984 | } |
| 985 | |
| 986 | void CmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects) { |
| 987 | } |
| 988 | |
| 989 | void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects) { |
| 990 | } |
| 991 | |
| 992 | void CmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) { |
| 993 | } |
| 994 | |
| 995 | void CmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
| 996 | } |
| 997 | |
| 998 | void CmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
| 999 | } |
| 1000 | |
| 1001 | void CmdWaitEvents(VkCmdBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
| 1002 | } |
| 1003 | |
| 1004 | void CmdPipelineBarrier(VkCmdBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkBool32 byRegion, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
| 1005 | } |
| 1006 | |
| 1007 | void CmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
| 1008 | } |
| 1009 | |
| 1010 | void CmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) { |
| 1011 | } |
| 1012 | |
| 1013 | void CmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) { |
| 1014 | } |
| 1015 | |
| 1016 | void CmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset) { |
| 1017 | } |
| 1018 | |
| 1019 | void CmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags) { |
| 1020 | } |
| 1021 | |
| 1022 | void CmdPushConstants(VkCmdBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) { |
| 1023 | } |
| 1024 | |
| 1025 | void CmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkRenderPassContents contents) { |
| 1026 | } |
| 1027 | |
| 1028 | void CmdNextSubpass(VkCmdBuffer cmdBuffer, VkRenderPassContents contents) { |
| 1029 | } |
| 1030 | |
| 1031 | void CmdEndRenderPass(VkCmdBuffer cmdBuffer) { |
| 1032 | } |
| 1033 | |
| 1034 | void CmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers) { |
| 1035 | } |
| 1036 | |
| 1037 | #pragma clang diagnostic pop |
| 1038 | // clang-format on |
| 1039 | |
| 1040 | } // namespace null_driver |