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