blob: 93168ba041aa555cd19821206ea1d38fdad2dc92 [file] [log] [blame]
Jesse Halld02edcb2015-09-08 07:44:48 -07001/*
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 Hall04f4f472015-08-16 19:51:04 -070017#include <hardware/hwvulkan.h>
18
Jesse Hallbde8ee32015-09-01 16:24:29 -070019#include <inttypes.h>
20#include <string.h>
Jesse Hall1f91d392015-12-11 16:28:44 -080021#include <algorithm>
22#include <array>
Jesse Hall04f4f472015-08-16 19:51:04 -070023
Jesse Hall73ab0ac2015-08-25 15:09:15 +010024// #define LOG_NDEBUG 0
25#include <log/log.h>
Jesse Hall04f4f472015-08-16 19:51:04 -070026#include <utils/Errors.h>
27
Jesse Hall1f91d392015-12-11 16:28:44 -080028#include "null_driver_gen.h"
Jesse Hall04f4f472015-08-16 19:51:04 -070029
30using namespace null_driver;
31
32struct VkPhysicalDevice_T {
33 hwvulkan_dispatch_t dispatch;
34};
35
36struct VkInstance_T {
37 hwvulkan_dispatch_t dispatch;
Jesse Hall3fbc8562015-11-29 22:10:52 -080038 VkAllocationCallbacks allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -070039 VkPhysicalDevice_T physical_device;
40};
41
42struct VkQueue_T {
43 hwvulkan_dispatch_t dispatch;
44};
45
Jesse Hall3fbc8562015-11-29 22:10:52 -080046struct VkCommandBuffer_T {
Jesse Hall04f4f472015-08-16 19:51:04 -070047 hwvulkan_dispatch_t dispatch;
48};
49
Jesse Hallf8faf0c2015-08-31 11:34:32 -070050namespace {
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.
67namespace HandleType {
Jesse Hallc7a6eb52015-08-31 12:52:03 -070068enum Enum {
Jesse Hallc7a6eb52015-08-31 12:52:03 -070069 kBufferView,
Jesse Hallc7a6eb52015-08-31 12:52:03 -070070 kDescriptorPool,
71 kDescriptorSet,
72 kDescriptorSetLayout,
Jesse Hallc7a6eb52015-08-31 12:52:03 -070073 kEvent,
74 kFence,
75 kFramebuffer,
76 kImageView,
77 kPipeline,
78 kPipelineCache,
79 kPipelineLayout,
80 kQueryPool,
81 kRenderPass,
82 kSampler,
83 kSemaphore,
Jesse Hallc7a6eb52015-08-31 12:52:03 -070084 kShaderModule,
Jesse Hallf8faf0c2015-08-31 11:34:32 -070085
Jesse Hallc7a6eb52015-08-31 12:52:03 -070086 kNumTypes
87};
88} // namespace HandleType
Jesse Hallf8faf0c2015-08-31 11:34:32 -070089uint64_t AllocHandle(VkDevice device, HandleType::Enum type);
Jesse Hallbde8ee32015-09-01 16:24:29 -070090
91const VkDeviceSize kMaxDeviceMemory = VkDeviceSize(INTPTR_MAX) + 1;
92
Jesse Hallc7a6eb52015-08-31 12:52:03 -070093} // anonymous namespace
Jesse Hallf8faf0c2015-08-31 11:34:32 -070094
Jesse Hall04f4f472015-08-16 19:51:04 -070095struct VkDevice_T {
96 hwvulkan_dispatch_t dispatch;
Jesse Hall3fbc8562015-11-29 22:10:52 -080097 VkAllocationCallbacks allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -070098 VkInstance_T* instance;
99 VkQueue_T queue;
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700100 std::array<uint64_t, HandleType::kNumTypes> next_handle;
Jesse Hall04f4f472015-08-16 19:51:04 -0700101};
102
103// -----------------------------------------------------------------------------
104// Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device
105// later.
106
107namespace {
108int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device);
109hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice};
110} // namespace
111
112#pragma clang diagnostic push
113#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
114__attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = {
115 .common =
116 {
Michael Lentine03c64b02015-08-26 18:27:26 -0500117 .tag = HARDWARE_MODULE_TAG,
118 .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1,
119 .hal_api_version = HARDWARE_HAL_API_VERSION,
120 .id = HWVULKAN_HARDWARE_MODULE_ID,
121 .name = "Null Vulkan Driver",
122 .author = "The Android Open Source Project",
123 .methods = &nulldrv_module_methods,
Jesse Hall04f4f472015-08-16 19:51:04 -0700124 },
125};
126#pragma clang diagnostic pop
127
128// -----------------------------------------------------------------------------
129
130namespace {
131
Jesse Hall04f4f472015-08-16 19:51:04 -0700132int CloseDevice(struct hw_device_t* /*device*/) {
133 // nothing to do - opening a device doesn't allocate any resources
134 return 0;
135}
136
137hwvulkan_device_t nulldrv_device = {
138 .common =
139 {
Michael Lentine03c64b02015-08-26 18:27:26 -0500140 .tag = HARDWARE_DEVICE_TAG,
141 .version = HWVULKAN_DEVICE_API_VERSION_0_1,
142 .module = &HAL_MODULE_INFO_SYM.common,
143 .close = CloseDevice,
Jesse Hall04f4f472015-08-16 19:51:04 -0700144 },
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700145 .EnumerateInstanceExtensionProperties =
146 EnumerateInstanceExtensionProperties,
Jesse Hall04f4f472015-08-16 19:51:04 -0700147 .CreateInstance = CreateInstance,
148 .GetInstanceProcAddr = GetInstanceProcAddr};
149
150int OpenDevice(const hw_module_t* /*module*/,
151 const char* id,
152 hw_device_t** device) {
153 if (strcmp(id, HWVULKAN_DEVICE_0) == 0) {
154 *device = &nulldrv_device.common;
155 return 0;
156 }
157 return -ENOENT;
158}
159
160VkInstance_T* GetInstanceFromPhysicalDevice(
161 VkPhysicalDevice_T* physical_device) {
162 return reinterpret_cast<VkInstance_T*>(
163 reinterpret_cast<uintptr_t>(physical_device) -
164 offsetof(VkInstance_T, physical_device));
165}
166
Michael Lentine3fec89e2015-12-04 16:25:11 -0800167template <class Handle>
168Handle AllocHandle(VkDevice device, HandleType::Enum type) {
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700169 const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1;
170 ALOGE_IF(device->next_handle[type] == kHandleMask,
Jesse Hallbde8ee32015-09-01 16:24:29 -0700171 "non-dispatchable handles of type=%u are about to overflow", type);
Michael Lentine3fec89e2015-12-04 16:25:11 -0800172 return reinterpret_cast<Handle>(
173 (UINT64_C(1) << 63) | ((uint64_t(type) & 0x7) << 56) |
174 (device->next_handle[type]++ & kHandleMask));
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700175}
176
Jesse Hall04f4f472015-08-16 19:51:04 -0700177} // namespace
178
179namespace null_driver {
180
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800181#define DEFINE_OBJECT_HANDLE_CONVERSION(T) \
182 T* Get##T##FromHandle(Vk##T h); \
183 T* Get##T##FromHandle(Vk##T h) { \
184 return reinterpret_cast<T*>(uintptr_t(h)); \
185 } \
186 Vk##T GetHandleTo##T(const T* obj); \
187 Vk##T GetHandleTo##T(const T* obj) { \
188 return Vk##T(reinterpret_cast<uintptr_t>(obj)); \
189 }
Jesse Hallf6578742015-08-29 17:06:12 +0100190
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100191// -----------------------------------------------------------------------------
192// Global
193
Jesse Halle1b12782015-11-30 11:27:32 -0800194VKAPI_ATTR
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700195VkResult EnumerateInstanceExtensionProperties(const char*,
196 uint32_t* count,
197 VkExtensionProperties*) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100198 *count = 0;
199 return VK_SUCCESS;
200}
201
Jesse Halle1b12782015-11-30 11:27:32 -0800202VKAPI_ATTR
Jesse Hall1f91d392015-12-11 16:28:44 -0800203VkResult CreateInstance(const VkInstanceCreateInfo* /*create_info*/,
204 const VkAllocationCallbacks* allocator,
205 VkInstance* out_instance) {
206 // Assume the loader provided alloc callbacks even if the app didn't.
207 ALOG_ASSERT(
208 allocator,
209 "Missing alloc callbacks, loader or app should have provided them");
210
211 VkInstance_T* instance =
212 static_cast<VkInstance_T*>(allocator->pfnAllocation(
213 allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T),
214 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE));
215 if (!instance)
216 return VK_ERROR_OUT_OF_HOST_MEMORY;
217
218 instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
219 instance->allocator = *allocator;
220 instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
221
222 *out_instance = instance;
223 return VK_SUCCESS;
224}
225
226VKAPI_ATTR
227PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
228 return instance ? GetInstanceProcAddr(name) : GetGlobalProcAddr(name);
Jesse Hall04f4f472015-08-16 19:51:04 -0700229}
230
Jesse Halle1b12782015-11-30 11:27:32 -0800231VKAPI_ATTR
Jesse Hall04f4f472015-08-16 19:51:04 -0700232PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) {
Jesse Hall1f91d392015-12-11 16:28:44 -0800233 return GetInstanceProcAddr(name);
Jesse Hall04f4f472015-08-16 19:51:04 -0700234}
235
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100236// -----------------------------------------------------------------------------
237// Instance
238
Jesse Hall03b6fe12015-11-24 12:44:21 -0800239void DestroyInstance(VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800240 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800241 instance->allocator.pfnFree(instance->allocator.pUserData, instance);
Jesse Hall04f4f472015-08-16 19:51:04 -0700242}
243
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100244// -----------------------------------------------------------------------------
245// PhysicalDevice
246
Jesse Hall04f4f472015-08-16 19:51:04 -0700247VkResult EnumeratePhysicalDevices(VkInstance instance,
248 uint32_t* physical_device_count,
249 VkPhysicalDevice* physical_devices) {
250 if (physical_devices && *physical_device_count >= 1)
251 physical_devices[0] = &instance->physical_device;
252 *physical_device_count = 1;
253 return VK_SUCCESS;
254}
255
Jesse Hall606a54e2015-11-19 22:17:28 -0800256void GetPhysicalDeviceProperties(VkPhysicalDevice,
257 VkPhysicalDeviceProperties* properties) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700258 properties->apiVersion = VK_API_VERSION;
259 properties->driverVersion = VK_MAKE_VERSION(0, 0, 1);
Jesse Hall65ab5522015-11-30 00:07:16 -0800260 properties->vendorID = 0;
261 properties->deviceID = 0;
Jesse Hall04f4f472015-08-16 19:51:04 -0700262 properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
263 strcpy(properties->deviceName, "Android Vulkan Null Driver");
264 memset(properties->pipelineCacheUUID, 0,
265 sizeof(properties->pipelineCacheUUID));
Jesse Hall04f4f472015-08-16 19:51:04 -0700266}
267
Jesse Hall606a54e2015-11-19 22:17:28 -0800268void GetPhysicalDeviceQueueFamilyProperties(
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700269 VkPhysicalDevice,
270 uint32_t* count,
271 VkQueueFamilyProperties* properties) {
272 if (properties) {
Jesse Hall65ab5522015-11-30 00:07:16 -0800273 properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT |
274 VK_QUEUE_TRANSFER_BIT;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700275 properties->queueCount = 1;
Jesse Hallacfa5342015-11-19 21:51:33 -0800276 properties->timestampValidBits = 64;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700277 }
278 *count = 1;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700279}
280
Jesse Hall606a54e2015-11-19 22:17:28 -0800281void GetPhysicalDeviceMemoryProperties(
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100282 VkPhysicalDevice,
283 VkPhysicalDeviceMemoryProperties* properties) {
284 properties->memoryTypeCount = 1;
285 properties->memoryTypes[0].propertyFlags =
Jesse Halld1af8122015-11-29 23:50:38 -0800286 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
287 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
288 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
289 VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100290 properties->memoryTypes[0].heapIndex = 0;
291 properties->memoryHeapCount = 1;
Jesse Hallbde8ee32015-09-01 16:24:29 -0700292 properties->memoryHeaps[0].size = kMaxDeviceMemory;
Jesse Halld1af8122015-11-29 23:50:38 -0800293 properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
Jesse Hall04f4f472015-08-16 19:51:04 -0700294}
295
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100296// -----------------------------------------------------------------------------
297// Device
298
Jesse Hall04f4f472015-08-16 19:51:04 -0700299VkResult CreateDevice(VkPhysicalDevice physical_device,
300 const VkDeviceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800301 const VkAllocationCallbacks* allocator,
Jesse Hall04f4f472015-08-16 19:51:04 -0700302 VkDevice* out_device) {
303 VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800304 if (!allocator)
305 allocator = &instance->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800306 VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation(
307 allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T),
308 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE));
Jesse Hall04f4f472015-08-16 19:51:04 -0700309 if (!device)
310 return VK_ERROR_OUT_OF_HOST_MEMORY;
311
312 device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800313 device->allocator = *allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700314 device->instance = instance;
315 device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700316 std::fill(device->next_handle.begin(), device->next_handle.end(),
317 UINT64_C(0));
Jesse Hall04f4f472015-08-16 19:51:04 -0700318
319 *out_device = device;
320 return VK_SUCCESS;
321}
322
Jesse Hall3fbc8562015-11-29 22:10:52 -0800323void DestroyDevice(VkDevice device,
324 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700325 if (!device)
Jesse Hallcf25c412015-10-29 17:14:50 -0700326 return;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800327 device->allocator.pfnFree(device->allocator.pUserData, device);
Jesse Hall04f4f472015-08-16 19:51:04 -0700328}
329
Jesse Hall606a54e2015-11-19 22:17:28 -0800330void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700331 *queue = &device->queue;
Jesse Hall04f4f472015-08-16 19:51:04 -0700332}
333
334// -----------------------------------------------------------------------------
Jesse Hall3fbc8562015-11-29 22:10:52 -0800335// CommandPool
Jesse Hall03b6fe12015-11-24 12:44:21 -0800336
Jesse Hall3fbc8562015-11-29 22:10:52 -0800337struct CommandPool {
338 typedef VkCommandPool HandleType;
339 VkAllocationCallbacks allocator;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800340};
Jesse Hall3fbc8562015-11-29 22:10:52 -0800341DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800342
343VkResult CreateCommandPool(VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800344 const VkCommandPoolCreateInfo* /*create_info*/,
345 const VkAllocationCallbacks* allocator,
346 VkCommandPool* cmd_pool) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800347 if (!allocator)
348 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349 CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation(
350 allocator->pUserData, sizeof(CommandPool), alignof(CommandPool),
351 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall03b6fe12015-11-24 12:44:21 -0800352 if (!pool)
353 return VK_ERROR_OUT_OF_HOST_MEMORY;
354 pool->allocator = *allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800355 *cmd_pool = GetHandleToCommandPool(pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800356 return VK_SUCCESS;
357}
358
359void DestroyCommandPool(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800360 VkCommandPool cmd_pool,
361 const VkAllocationCallbacks* /*allocator*/) {
362 CommandPool* pool = GetCommandPoolFromHandle(cmd_pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800363 pool->allocator.pfnFree(pool->allocator.pUserData, pool);
364}
365
366// -----------------------------------------------------------------------------
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700367// CmdBuffer
368
Jesse Hall3fbc8562015-11-29 22:10:52 -0800369VkResult AllocateCommandBuffers(VkDevice /*device*/,
370 const VkCommandBufferAllocateInfo* alloc_info,
371 VkCommandBuffer* cmdbufs) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800372 VkResult result = VK_SUCCESS;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800373 CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool);
Jesse Hall3dd678a2016-01-08 21:52:01 -0800374 std::fill(cmdbufs, cmdbufs + alloc_info->commandBufferCount, nullptr);
375 for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800376 cmdbufs[i] =
377 static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation(
378 pool.allocator.pUserData, sizeof(VkCommandBuffer_T),
379 alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallfbf97b02015-11-20 14:17:03 -0800380 if (!cmdbufs[i]) {
381 result = VK_ERROR_OUT_OF_HOST_MEMORY;
382 break;
383 }
384 cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
385 }
386 if (result != VK_SUCCESS) {
Jesse Hall3dd678a2016-01-08 21:52:01 -0800387 for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800388 if (!cmdbufs[i])
389 break;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800390 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800391 }
392 }
Jesse Hallfbf97b02015-11-20 14:17:03 -0800393 return result;
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700394}
395
Jesse Hall03b6fe12015-11-24 12:44:21 -0800396void FreeCommandBuffers(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800397 VkCommandPool cmd_pool,
Jesse Hallfbf97b02015-11-20 14:17:03 -0800398 uint32_t count,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800399 const VkCommandBuffer* cmdbufs) {
400 CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800401 for (uint32_t i = 0; i < count; i++)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800402 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700403}
404
405// -----------------------------------------------------------------------------
Jesse Hall2077ce02015-08-29 18:10:59 +0100406// DeviceMemory
407
408struct DeviceMemory {
409 typedef VkDeviceMemory HandleType;
410 VkDeviceSize size;
411 alignas(16) uint8_t data[0];
412};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800413DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory)
Jesse Hall2077ce02015-08-29 18:10:59 +0100414
Jesse Hall3fbc8562015-11-29 22:10:52 -0800415VkResult AllocateMemory(VkDevice device,
416 const VkMemoryAllocateInfo* alloc_info,
417 const VkAllocationCallbacks* allocator,
418 VkDeviceMemory* mem_handle) {
Jesse Hall2077ce02015-08-29 18:10:59 +0100419 if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize)
420 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800421 if (!allocator)
422 allocator = &device->allocator;
Jesse Hall2077ce02015-08-29 18:10:59 +0100423
Jesse Hall2077ce02015-08-29 18:10:59 +0100424 size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize);
Jesse Hall3fbc8562015-11-29 22:10:52 -0800425 DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation(
426 allocator->pUserData, size, alignof(DeviceMemory),
427 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall2077ce02015-08-29 18:10:59 +0100428 if (!mem)
429 return VK_ERROR_OUT_OF_HOST_MEMORY;
430 mem->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800431 *mem_handle = GetHandleToDeviceMemory(mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100432 return VK_SUCCESS;
433}
434
Jesse Hall03b6fe12015-11-24 12:44:21 -0800435void FreeMemory(VkDevice device,
436 VkDeviceMemory mem_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800437 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800438 if (!allocator)
439 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800440 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800441 allocator->pfnFree(allocator->pUserData, mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100442}
443
444VkResult MapMemory(VkDevice,
445 VkDeviceMemory mem_handle,
446 VkDeviceSize offset,
447 VkDeviceSize,
448 VkMemoryMapFlags,
449 void** out_ptr) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800450 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall2077ce02015-08-29 18:10:59 +0100451 *out_ptr = &mem->data[0] + offset;
452 return VK_SUCCESS;
453}
454
455// -----------------------------------------------------------------------------
Jesse Hallf6578742015-08-29 17:06:12 +0100456// Buffer
457
458struct Buffer {
459 typedef VkBuffer HandleType;
460 VkDeviceSize size;
461};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800462DEFINE_OBJECT_HANDLE_CONVERSION(Buffer)
Jesse Hallf6578742015-08-29 17:06:12 +0100463
464VkResult CreateBuffer(VkDevice device,
465 const VkBufferCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800466 const VkAllocationCallbacks* allocator,
Jesse Hallf6578742015-08-29 17:06:12 +0100467 VkBuffer* buffer_handle) {
Jesse Hallbde8ee32015-09-01 16:24:29 -0700468 ALOGW_IF(create_info->size > kMaxDeviceMemory,
469 "CreateBuffer: requested size 0x%" PRIx64
470 " exceeds max device memory size 0x%" PRIx64,
471 create_info->size, kMaxDeviceMemory);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800472 if (!allocator)
473 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800474 Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation(
475 allocator->pUserData, sizeof(Buffer), alignof(Buffer),
476 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallf6578742015-08-29 17:06:12 +0100477 if (!buffer)
478 return VK_ERROR_OUT_OF_HOST_MEMORY;
479 buffer->size = create_info->size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800480 *buffer_handle = GetHandleToBuffer(buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100481 return VK_SUCCESS;
482}
483
Jesse Hall606a54e2015-11-19 22:17:28 -0800484void GetBufferMemoryRequirements(VkDevice,
485 VkBuffer buffer_handle,
486 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800487 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hallf6578742015-08-29 17:06:12 +0100488 requirements->size = buffer->size;
489 requirements->alignment = 16; // allow fast Neon/SSE memcpy
490 requirements->memoryTypeBits = 0x1;
Jesse Hallf6578742015-08-29 17:06:12 +0100491}
492
Jesse Hall03b6fe12015-11-24 12:44:21 -0800493void DestroyBuffer(VkDevice device,
494 VkBuffer buffer_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800495 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800496 if (!allocator)
497 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800498 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800499 allocator->pfnFree(allocator->pUserData, buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100500}
501
502// -----------------------------------------------------------------------------
Jesse Hall85c05b62015-09-01 18:07:41 -0700503// Image
504
505struct Image {
506 typedef VkImage HandleType;
507 VkDeviceSize size;
508};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800509DEFINE_OBJECT_HANDLE_CONVERSION(Image)
Jesse Hall85c05b62015-09-01 18:07:41 -0700510
511VkResult CreateImage(VkDevice device,
512 const VkImageCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800513 const VkAllocationCallbacks* allocator,
Jesse Hall85c05b62015-09-01 18:07:41 -0700514 VkImage* image_handle) {
515 if (create_info->imageType != VK_IMAGE_TYPE_2D ||
516 create_info->format != VK_FORMAT_R8G8B8A8_UNORM ||
517 create_info->mipLevels != 1) {
518 ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u",
519 create_info->imageType, create_info->format,
520 create_info->mipLevels);
Jesse Halla15a4bf2015-11-19 22:48:02 -0800521 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall85c05b62015-09-01 18:07:41 -0700522 }
523
524 VkDeviceSize size =
525 VkDeviceSize(create_info->extent.width * create_info->extent.height) *
Jesse Halla15a4bf2015-11-19 22:48:02 -0800526 create_info->arrayLayers * create_info->samples * 4u;
Jesse Hall85c05b62015-09-01 18:07:41 -0700527 ALOGW_IF(size > kMaxDeviceMemory,
528 "CreateImage: image size 0x%" PRIx64
529 " exceeds max device memory size 0x%" PRIx64,
530 size, kMaxDeviceMemory);
531
Jesse Hall03b6fe12015-11-24 12:44:21 -0800532 if (!allocator)
533 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800534 Image* image = static_cast<Image*>(allocator->pfnAllocation(
535 allocator->pUserData, sizeof(Image), alignof(Image),
536 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall85c05b62015-09-01 18:07:41 -0700537 if (!image)
538 return VK_ERROR_OUT_OF_HOST_MEMORY;
539 image->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800540 *image_handle = GetHandleToImage(image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700541 return VK_SUCCESS;
542}
543
Jesse Hall606a54e2015-11-19 22:17:28 -0800544void GetImageMemoryRequirements(VkDevice,
545 VkImage image_handle,
546 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800547 Image* image = GetImageFromHandle(image_handle);
Jesse Hall85c05b62015-09-01 18:07:41 -0700548 requirements->size = image->size;
549 requirements->alignment = 16; // allow fast Neon/SSE memcpy
550 requirements->memoryTypeBits = 0x1;
Jesse Hall85c05b62015-09-01 18:07:41 -0700551}
552
Jesse Hall03b6fe12015-11-24 12:44:21 -0800553void DestroyImage(VkDevice device,
554 VkImage image_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800555 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800556 if (!allocator)
557 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800558 Image* image = GetImageFromHandle(image_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800559 allocator->pfnFree(allocator->pUserData, image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700560}
561
562// -----------------------------------------------------------------------------
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700563// No-op types
564
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700565VkResult CreateBufferView(VkDevice device,
566 const VkBufferViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800567 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700568 VkBufferView* view) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800569 *view = AllocHandle<VkBufferView>(device, HandleType::kBufferView);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700570 return VK_SUCCESS;
571}
572
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700573VkResult CreateDescriptorPool(VkDevice device,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700574 const VkDescriptorPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800575 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700576 VkDescriptorPool* pool) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800577 *pool = AllocHandle<VkDescriptorPool>(device, HandleType::kDescriptorPool);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700578 return VK_SUCCESS;
579}
580
Jesse Hall3fbc8562015-11-29 22:10:52 -0800581VkResult AllocateDescriptorSets(VkDevice device,
582 const VkDescriptorSetAllocateInfo* alloc_info,
583 VkDescriptorSet* descriptor_sets) {
Jesse Hall3dd678a2016-01-08 21:52:01 -0800584 for (uint32_t i = 0; i < alloc_info->descriptorSetCount; i++)
Michael Lentine3fec89e2015-12-04 16:25:11 -0800585 descriptor_sets[i] =
586 AllocHandle<VkDescriptorSet>(device, HandleType::kDescriptorSet);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700587 return VK_SUCCESS;
588}
589
590VkResult CreateDescriptorSetLayout(VkDevice device,
591 const VkDescriptorSetLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800592 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700593 VkDescriptorSetLayout* layout) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800594 *layout = AllocHandle<VkDescriptorSetLayout>(
595 device, HandleType::kDescriptorSetLayout);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700596 return VK_SUCCESS;
597}
598
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700599VkResult CreateEvent(VkDevice device,
600 const VkEventCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800601 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700602 VkEvent* event) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800603 *event = AllocHandle<VkEvent>(device, HandleType::kEvent);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700604 return VK_SUCCESS;
605}
606
607VkResult CreateFence(VkDevice device,
608 const VkFenceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800609 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700610 VkFence* fence) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800611 *fence = AllocHandle<VkFence>(device, HandleType::kFence);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700612 return VK_SUCCESS;
613}
614
615VkResult CreateFramebuffer(VkDevice device,
616 const VkFramebufferCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800617 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700618 VkFramebuffer* framebuffer) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800619 *framebuffer = AllocHandle<VkFramebuffer>(device, HandleType::kFramebuffer);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700620 return VK_SUCCESS;
621}
622
623VkResult CreateImageView(VkDevice device,
624 const VkImageViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800625 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700626 VkImageView* view) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800627 *view = AllocHandle<VkImageView>(device, HandleType::kImageView);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700628 return VK_SUCCESS;
629}
630
631VkResult CreateGraphicsPipelines(VkDevice device,
632 VkPipelineCache,
633 uint32_t count,
634 const VkGraphicsPipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800635 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700636 VkPipeline* pipelines) {
637 for (uint32_t i = 0; i < count; i++)
Michael Lentine3fec89e2015-12-04 16:25:11 -0800638 pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700639 return VK_SUCCESS;
640}
641
642VkResult CreateComputePipelines(VkDevice device,
643 VkPipelineCache,
644 uint32_t count,
645 const VkComputePipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800646 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700647 VkPipeline* pipelines) {
648 for (uint32_t i = 0; i < count; i++)
Michael Lentine3fec89e2015-12-04 16:25:11 -0800649 pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700650 return VK_SUCCESS;
651}
652
653VkResult CreatePipelineCache(VkDevice device,
654 const VkPipelineCacheCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800655 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700656 VkPipelineCache* cache) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800657 *cache = AllocHandle<VkPipelineCache>(device, HandleType::kPipelineCache);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700658 return VK_SUCCESS;
659}
660
661VkResult CreatePipelineLayout(VkDevice device,
662 const VkPipelineLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800663 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700664 VkPipelineLayout* layout) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800665 *layout =
666 AllocHandle<VkPipelineLayout>(device, HandleType::kPipelineLayout);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700667 return VK_SUCCESS;
668}
669
670VkResult CreateQueryPool(VkDevice device,
671 const VkQueryPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800672 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700673 VkQueryPool* pool) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800674 *pool = AllocHandle<VkQueryPool>(device, HandleType::kQueryPool);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700675 return VK_SUCCESS;
676}
677
678VkResult CreateRenderPass(VkDevice device,
679 const VkRenderPassCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800680 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700681 VkRenderPass* renderpass) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800682 *renderpass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700683 return VK_SUCCESS;
684}
685
686VkResult CreateSampler(VkDevice device,
687 const VkSamplerCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800688 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700689 VkSampler* sampler) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800690 *sampler = AllocHandle<VkSampler>(device, HandleType::kSampler);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700691 return VK_SUCCESS;
692}
693
694VkResult CreateSemaphore(VkDevice device,
695 const VkSemaphoreCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800696 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700697 VkSemaphore* semaphore) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800698 *semaphore = AllocHandle<VkSemaphore>(device, HandleType::kSemaphore);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700699 return VK_SUCCESS;
700}
701
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700702VkResult CreateShaderModule(VkDevice device,
703 const VkShaderModuleCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800704 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700705 VkShaderModule* module) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800706 *module = AllocHandle<VkShaderModule>(device, HandleType::kShaderModule);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700707 return VK_SUCCESS;
708}
709
Jesse Hall70f93352015-11-04 09:41:31 -0800710VkResult GetSwapchainGrallocUsageANDROID(VkDevice,
711 VkFormat,
712 VkImageUsageFlags,
713 int* grallocUsage) {
714 // The null driver never reads or writes the gralloc buffer
715 *grallocUsage = 0;
716 return VK_SUCCESS;
717}
718
Jesse Hall1f91d392015-12-11 16:28:44 -0800719VkResult AcquireImageANDROID(VkDevice,
720 VkImage,
721 int fence,
722 VkSemaphore,
723 VkFence) {
Jesse Halld7b994a2015-09-07 14:17:37 -0700724 close(fence);
725 return VK_SUCCESS;
726}
727
Jesse Hall275d76c2016-01-08 22:39:16 -0800728VkResult QueueSignalReleaseImageANDROID(VkQueue,
729 uint32_t,
730 const VkSemaphore*,
731 VkImage,
732 int* fence) {
Jesse Halld7b994a2015-09-07 14:17:37 -0700733 *fence = -1;
734 return VK_SUCCESS;
735}
736
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700737// -----------------------------------------------------------------------------
Jesse Hall04f4f472015-08-16 19:51:04 -0700738// No-op entrypoints
739
740// clang-format off
741#pragma clang diagnostic push
742#pragma clang diagnostic ignored "-Wunused-parameter"
743
Jesse Hall606a54e2015-11-19 22:17:28 -0800744void GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100745 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700746}
747
Jesse Hall606a54e2015-11-19 22:17:28 -0800748void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100749 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700750}
751
Jesse Halla9e57032015-11-30 01:03:10 -0800752VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100753 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Halla9e57032015-11-30 01:03:10 -0800754 return VK_SUCCESS;
Jesse Hall04f4f472015-08-16 19:51:04 -0700755}
756
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700757VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100758 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700759 return VK_SUCCESS;
760}
761
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700762VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100763 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700764 return VK_SUCCESS;
765}
766
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700767VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100768 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700769 return VK_SUCCESS;
770}
771
Jesse Halla366a512015-11-19 22:30:07 -0800772VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700773 return VK_SUCCESS;
774}
775
776VkResult QueueWaitIdle(VkQueue queue) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100777 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700778 return VK_SUCCESS;
779}
780
781VkResult DeviceWaitIdle(VkDevice device) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100782 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700783 return VK_SUCCESS;
784}
785
Jesse Hallcf25c412015-10-29 17:14:50 -0700786void UnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700787}
788
789VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100790 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700791 return VK_SUCCESS;
792}
793
794VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100795 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700796 return VK_SUCCESS;
797}
798
Jesse Hall606a54e2015-11-19 22:17:28 -0800799void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100800 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700801}
802
Jesse Hall04f4f472015-08-16 19:51:04 -0700803VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) {
804 return VK_SUCCESS;
805}
806
Jesse Hall04f4f472015-08-16 19:51:04 -0700807VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) {
808 return VK_SUCCESS;
809}
810
Jesse Hall606a54e2015-11-19 22:17:28 -0800811void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100812 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700813}
814
Jesse Hall091ed9e2015-11-30 00:55:29 -0800815void GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100816 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700817}
818
Jesse Halla6429252015-11-29 18:59:42 -0800819VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100820 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700821 return VK_SUCCESS;
822}
823
Jesse Hall3fbc8562015-11-29 22:10:52 -0800824void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700825}
826
827VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
828 return VK_SUCCESS;
829}
830
831VkResult GetFenceStatus(VkDevice device, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100832 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700833 return VK_SUCCESS;
834}
835
836VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {
837 return VK_SUCCESS;
838}
839
Jesse Hall3fbc8562015-11-29 22:10:52 -0800840void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700841}
842
Jesse Hall3fbc8562015-11-29 22:10:52 -0800843void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700844}
845
846VkResult GetEventStatus(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100847 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700848 return VK_SUCCESS;
849}
850
851VkResult SetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100852 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700853 return VK_SUCCESS;
854}
855
856VkResult ResetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100857 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700858 return VK_SUCCESS;
859}
860
Jesse Hall3fbc8562015-11-29 22:10:52 -0800861void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700862}
863
Jesse Halla9bb62b2015-11-21 19:31:56 -0800864VkResult GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100865 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700866 return VK_SUCCESS;
867}
868
Jesse Hall3fbc8562015-11-29 22:10:52 -0800869void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700870}
871
Jesse Hall606a54e2015-11-19 22:17:28 -0800872void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100873 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700874}
875
Jesse Hall3fbc8562015-11-29 22:10:52 -0800876void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700877}
878
Jesse Hall3fbc8562015-11-29 22:10:52 -0800879void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700880}
881
Jesse Hall3fbc8562015-11-29 22:10:52 -0800882void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700883}
884
Jesse Halla9bb62b2015-11-21 19:31:56 -0800885VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100886 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700887 return VK_SUCCESS;
888}
889
890VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100891 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700892 return VK_SUCCESS;
893}
894
Jesse Hall3fbc8562015-11-29 22:10:52 -0800895void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700896}
897
Jesse Hall3fbc8562015-11-29 22:10:52 -0800898void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700899}
900
Jesse Hall3fbc8562015-11-29 22:10:52 -0800901void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700902}
903
Jesse Hall3fbc8562015-11-29 22:10:52 -0800904void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700905}
906
Jesse Hall3fbc8562015-11-29 22:10:52 -0800907void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700908}
909
Jesse Hallfbf97b02015-11-20 14:17:03 -0800910VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100911 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700912 return VK_SUCCESS;
913}
914
Jesse Hallcf25c412015-10-29 17:14:50 -0700915void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100916 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700917}
918
919VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100920 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700921 return VK_SUCCESS;
922}
923
Jesse Hall3fbc8562015-11-29 22:10:52 -0800924void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700925}
926
Jesse Hall3fbc8562015-11-29 22:10:52 -0800927void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700928}
929
Jesse Hall606a54e2015-11-19 22:17:28 -0800930void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100931 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700932}
933
Jesse Hall3fbc8562015-11-29 22:10:52 -0800934VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100935 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700936 return VK_SUCCESS;
937}
938
Jesse Hall3fbc8562015-11-29 22:10:52 -0800939VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700940 return VK_SUCCESS;
941}
942
Jesse Hall3fbc8562015-11-29 22:10:52 -0800943VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700944 return VK_SUCCESS;
945}
946
Jesse Hall3fbc8562015-11-29 22:10:52 -0800947VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100948 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700949 return VK_SUCCESS;
950}
951
Jesse Hall3fbc8562015-11-29 22:10:52 -0800952void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700953}
954
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800955void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700956}
957
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800958void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700959}
960
Jesse Hall3fbc8562015-11-29 22:10:52 -0800961void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700962}
963
Jesse Hall3fbc8562015-11-29 22:10:52 -0800964void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700965}
966
Jesse Hall3fbc8562015-11-29 22:10:52 -0800967void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700968}
969
Jesse Hall3fbc8562015-11-29 22:10:52 -0800970void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700971}
972
Jesse Hall3fbc8562015-11-29 22:10:52 -0800973void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700974}
975
Jesse Hall3fbc8562015-11-29 22:10:52 -0800976void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700977}
978
Jesse Hall3fbc8562015-11-29 22:10:52 -0800979void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700980}
981
Jesse Hall3fbc8562015-11-29 22:10:52 -0800982void CmdBindDescriptorSets(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700983}
984
Jesse Hall3fbc8562015-11-29 22:10:52 -0800985void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700986}
987
Jesse Hall3fbc8562015-11-29 22:10:52 -0800988void CmdBindVertexBuffers(VkCommandBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700989}
990
Jesse Hall3fbc8562015-11-29 22:10:52 -0800991void CmdDraw(VkCommandBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700992}
993
Jesse Hall3fbc8562015-11-29 22:10:52 -0800994void CmdDrawIndexed(VkCommandBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700995}
996
Jesse Hall3fbc8562015-11-29 22:10:52 -0800997void CmdDrawIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700998}
999
Jesse Hall3fbc8562015-11-29 22:10:52 -08001000void CmdDrawIndexedIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001001}
1002
Jesse Hall3fbc8562015-11-29 22:10:52 -08001003void CmdDispatch(VkCommandBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001004}
1005
Jesse Hall3fbc8562015-11-29 22:10:52 -08001006void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001007}
1008
Jesse Hall3fbc8562015-11-29 22:10:52 -08001009void CmdCopyBuffer(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001010}
1011
Jesse Hall3fbc8562015-11-29 22:10:52 -08001012void CmdCopyImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001013}
1014
Jesse Hall3fbc8562015-11-29 22:10:52 -08001015void CmdBlitImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001016}
1017
Jesse Hall3fbc8562015-11-29 22:10:52 -08001018void CmdCopyBufferToImage(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001019}
1020
Jesse Hall3fbc8562015-11-29 22:10:52 -08001021void CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001022}
1023
Jesse Hall3fbc8562015-11-29 22:10:52 -08001024void CmdUpdateBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001025}
1026
Jesse Hall3fbc8562015-11-29 22:10:52 -08001027void CmdFillBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001028}
1029
Jesse Hall3fbc8562015-11-29 22:10:52 -08001030void CmdClearColorImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001031}
1032
Jesse Hall3fbc8562015-11-29 22:10:52 -08001033void CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001034}
1035
Jesse Hall3fbc8562015-11-29 22:10:52 -08001036void CmdClearAttachments(VkCommandBuffer cmdBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001037}
1038
Jesse Hall3fbc8562015-11-29 22:10:52 -08001039void CmdResolveImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001040}
1041
Jesse Hall3fbc8562015-11-29 22:10:52 -08001042void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001043}
1044
Jesse Hall3fbc8562015-11-29 22:10:52 -08001045void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001046}
1047
Jesse Hall3dd678a2016-01-08 21:52:01 -08001048void CmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001049}
1050
Jesse Hall3dd678a2016-01-08 21:52:01 -08001051void CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001052}
1053
Jesse Hall3fbc8562015-11-29 22:10:52 -08001054void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001055}
1056
Jesse Hall3fbc8562015-11-29 22:10:52 -08001057void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001058}
1059
Jesse Hall3fbc8562015-11-29 22:10:52 -08001060void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001061}
1062
Jesse Hall3fbc8562015-11-29 22:10:52 -08001063void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001064}
1065
Jesse Hall3fbc8562015-11-29 22:10:52 -08001066void CmdCopyQueryPoolResults(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001067}
1068
Jesse Hall3fbc8562015-11-29 22:10:52 -08001069void CmdPushConstants(VkCommandBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001070}
1071
Jesse Hall65ab5522015-11-30 00:07:16 -08001072void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001073}
1074
Jesse Hall65ab5522015-11-30 00:07:16 -08001075void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001076}
1077
Jesse Hall3fbc8562015-11-29 22:10:52 -08001078void CmdEndRenderPass(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001079}
1080
Jesse Hall3fbc8562015-11-29 22:10:52 -08001081void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001082}
1083
Jesse Hall04f4f472015-08-16 19:51:04 -07001084#pragma clang diagnostic pop
1085// clang-format on
1086
1087} // namespace null_driver