blob: 316d27f877f47a13131af22a1646ed10f9952831 [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 Hallf8faf0c2015-08-31 11:34:32 -070019#include <array>
Jesse Hall04f4f472015-08-16 19:51:04 -070020#include <algorithm>
Jesse Hallbde8ee32015-09-01 16:24:29 -070021#include <inttypes.h>
22#include <string.h>
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
28#include "null_driver.h"
29
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 Hall03b6fe12015-11-24 12:44:21 -0800132VkResult CreateInstance(const VkInstanceCreateInfo* /*create_info*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800133 const VkAllocationCallbacks* allocator,
Jesse Hall04f4f472015-08-16 19:51:04 -0700134 VkInstance* out_instance) {
Jesse Hallb1352bc2015-09-04 16:12:33 -0700135 // Assume the loader provided alloc callbacks even if the app didn't.
136 ALOG_ASSERT(
Jesse Hall03b6fe12015-11-24 12:44:21 -0800137 allocator,
Jesse Hallb1352bc2015-09-04 16:12:33 -0700138 "Missing alloc callbacks, loader or app should have provided them");
139
Jesse Hall3fbc8562015-11-29 22:10:52 -0800140 VkInstance_T* instance =
141 static_cast<VkInstance_T*>(allocator->pfnAllocation(
142 allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T),
143 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE));
Jesse Hall04f4f472015-08-16 19:51:04 -0700144 if (!instance)
145 return VK_ERROR_OUT_OF_HOST_MEMORY;
146
147 instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800148 instance->allocator = *allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700149 instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
150
151 *out_instance = instance;
152 return VK_SUCCESS;
153}
154
155int CloseDevice(struct hw_device_t* /*device*/) {
156 // nothing to do - opening a device doesn't allocate any resources
157 return 0;
158}
159
160hwvulkan_device_t nulldrv_device = {
161 .common =
162 {
Michael Lentine03c64b02015-08-26 18:27:26 -0500163 .tag = HARDWARE_DEVICE_TAG,
164 .version = HWVULKAN_DEVICE_API_VERSION_0_1,
165 .module = &HAL_MODULE_INFO_SYM.common,
166 .close = CloseDevice,
Jesse Hall04f4f472015-08-16 19:51:04 -0700167 },
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700168 .EnumerateInstanceExtensionProperties =
169 EnumerateInstanceExtensionProperties,
Jesse Hall04f4f472015-08-16 19:51:04 -0700170 .CreateInstance = CreateInstance,
171 .GetInstanceProcAddr = GetInstanceProcAddr};
172
173int 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
183VkInstance_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 Hallf8faf0c2015-08-31 11:34:32 -0700190uint64_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 Hallbde8ee32015-09-01 16:24:29 -0700193 "non-dispatchable handles of type=%u are about to overflow", type);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700194 return (UINT64_C(1) << 63) | ((uint64_t(type) & 0x7) << 56) |
195 (device->next_handle[type]++ & kHandleMask);
196}
197
Jesse Hall04f4f472015-08-16 19:51:04 -0700198} // namespace
199
200namespace null_driver {
201
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800202#define DEFINE_OBJECT_HANDLE_CONVERSION(T) \
203 T* Get##T##FromHandle(Vk##T h); \
204 T* Get##T##FromHandle(Vk##T h) { \
205 return reinterpret_cast<T*>(uintptr_t(h)); \
206 } \
207 Vk##T GetHandleTo##T(const T* obj); \
208 Vk##T GetHandleTo##T(const T* obj) { \
209 return Vk##T(reinterpret_cast<uintptr_t>(obj)); \
210 }
Jesse Hallf6578742015-08-29 17:06:12 +0100211
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100212// -----------------------------------------------------------------------------
213// Global
214
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700215VkResult EnumerateInstanceExtensionProperties(const char*,
216 uint32_t* count,
217 VkExtensionProperties*) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100218 *count = 0;
219 return VK_SUCCESS;
220}
221
Jesse Hall04f4f472015-08-16 19:51:04 -0700222PFN_vkVoidFunction GetInstanceProcAddr(VkInstance, const char* name) {
223 PFN_vkVoidFunction proc = LookupInstanceProcAddr(name);
224 if (!proc && strcmp(name, "vkGetDeviceProcAddr") == 0)
225 proc = reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr);
226 return proc;
227}
228
229PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) {
Jesse Hallb1352bc2015-09-04 16:12:33 -0700230 PFN_vkVoidFunction proc = LookupDeviceProcAddr(name);
231 if (proc)
232 return proc;
Jesse Hall70f93352015-11-04 09:41:31 -0800233 if (strcmp(name, "vkGetSwapchainGrallocUsageANDROID") == 0)
234 return reinterpret_cast<PFN_vkVoidFunction>(
235 GetSwapchainGrallocUsageANDROID);
Jesse Hallab9aeef2015-11-04 10:56:20 -0800236 if (strcmp(name, "vkAcquireImageANDROID") == 0)
237 return reinterpret_cast<PFN_vkVoidFunction>(AcquireImageANDROID);
238 if (strcmp(name, "vkQueueSignalReleaseImageANDROID") == 0)
Jesse Hallb1352bc2015-09-04 16:12:33 -0700239 return reinterpret_cast<PFN_vkVoidFunction>(
Jesse Hallab9aeef2015-11-04 10:56:20 -0800240 QueueSignalReleaseImageANDROID);
Jesse Hallb1352bc2015-09-04 16:12:33 -0700241 return nullptr;
Jesse Hall04f4f472015-08-16 19:51:04 -0700242}
243
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100244// -----------------------------------------------------------------------------
245// Instance
246
Jesse Hall03b6fe12015-11-24 12:44:21 -0800247void DestroyInstance(VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800248 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800249 instance->allocator.pfnFree(instance->allocator.pUserData, instance);
Jesse Hall04f4f472015-08-16 19:51:04 -0700250}
251
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100252// -----------------------------------------------------------------------------
253// PhysicalDevice
254
Jesse Hall04f4f472015-08-16 19:51:04 -0700255VkResult EnumeratePhysicalDevices(VkInstance instance,
256 uint32_t* physical_device_count,
257 VkPhysicalDevice* physical_devices) {
258 if (physical_devices && *physical_device_count >= 1)
259 physical_devices[0] = &instance->physical_device;
260 *physical_device_count = 1;
261 return VK_SUCCESS;
262}
263
Jesse Hall606a54e2015-11-19 22:17:28 -0800264void GetPhysicalDeviceProperties(VkPhysicalDevice,
265 VkPhysicalDeviceProperties* properties) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700266 properties->apiVersion = VK_API_VERSION;
267 properties->driverVersion = VK_MAKE_VERSION(0, 0, 1);
Jesse Hall65ab5522015-11-30 00:07:16 -0800268 properties->vendorID = 0;
269 properties->deviceID = 0;
Jesse Hall04f4f472015-08-16 19:51:04 -0700270 properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
271 strcpy(properties->deviceName, "Android Vulkan Null Driver");
272 memset(properties->pipelineCacheUUID, 0,
273 sizeof(properties->pipelineCacheUUID));
Jesse Hall04f4f472015-08-16 19:51:04 -0700274}
275
Jesse Hall606a54e2015-11-19 22:17:28 -0800276void GetPhysicalDeviceQueueFamilyProperties(
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700277 VkPhysicalDevice,
278 uint32_t* count,
279 VkQueueFamilyProperties* properties) {
280 if (properties) {
Jesse Hall65ab5522015-11-30 00:07:16 -0800281 properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT |
282 VK_QUEUE_TRANSFER_BIT;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700283 properties->queueCount = 1;
Jesse Hallacfa5342015-11-19 21:51:33 -0800284 properties->timestampValidBits = 64;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700285 }
286 *count = 1;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700287}
288
Jesse Hall606a54e2015-11-19 22:17:28 -0800289void GetPhysicalDeviceMemoryProperties(
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100290 VkPhysicalDevice,
291 VkPhysicalDeviceMemoryProperties* properties) {
292 properties->memoryTypeCount = 1;
293 properties->memoryTypes[0].propertyFlags =
Jesse Halld1af8122015-11-29 23:50:38 -0800294 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
295 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
296 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
297 VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100298 properties->memoryTypes[0].heapIndex = 0;
299 properties->memoryHeapCount = 1;
Jesse Hallbde8ee32015-09-01 16:24:29 -0700300 properties->memoryHeaps[0].size = kMaxDeviceMemory;
Jesse Halld1af8122015-11-29 23:50:38 -0800301 properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
Jesse Hall04f4f472015-08-16 19:51:04 -0700302}
303
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100304// -----------------------------------------------------------------------------
305// Device
306
Jesse Hall04f4f472015-08-16 19:51:04 -0700307VkResult CreateDevice(VkPhysicalDevice physical_device,
308 const VkDeviceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800309 const VkAllocationCallbacks* allocator,
Jesse Hall04f4f472015-08-16 19:51:04 -0700310 VkDevice* out_device) {
311 VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800312 if (!allocator)
313 allocator = &instance->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800314 VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation(
315 allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T),
316 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE));
Jesse Hall04f4f472015-08-16 19:51:04 -0700317 if (!device)
318 return VK_ERROR_OUT_OF_HOST_MEMORY;
319
320 device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800321 device->allocator = *allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700322 device->instance = instance;
323 device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700324 std::fill(device->next_handle.begin(), device->next_handle.end(),
325 UINT64_C(0));
Jesse Hall04f4f472015-08-16 19:51:04 -0700326
327 *out_device = device;
328 return VK_SUCCESS;
329}
330
Jesse Hall3fbc8562015-11-29 22:10:52 -0800331void DestroyDevice(VkDevice device,
332 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700333 if (!device)
Jesse Hallcf25c412015-10-29 17:14:50 -0700334 return;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800335 device->allocator.pfnFree(device->allocator.pUserData, device);
Jesse Hall04f4f472015-08-16 19:51:04 -0700336}
337
Jesse Hall606a54e2015-11-19 22:17:28 -0800338void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700339 *queue = &device->queue;
Jesse Hall04f4f472015-08-16 19:51:04 -0700340}
341
342// -----------------------------------------------------------------------------
Jesse Hall3fbc8562015-11-29 22:10:52 -0800343// CommandPool
Jesse Hall03b6fe12015-11-24 12:44:21 -0800344
Jesse Hall3fbc8562015-11-29 22:10:52 -0800345struct CommandPool {
346 typedef VkCommandPool HandleType;
347 VkAllocationCallbacks allocator;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800348};
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800350
351VkResult CreateCommandPool(VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800352 const VkCommandPoolCreateInfo* /*create_info*/,
353 const VkAllocationCallbacks* allocator,
354 VkCommandPool* cmd_pool) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800355 if (!allocator)
356 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800357 CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation(
358 allocator->pUserData, sizeof(CommandPool), alignof(CommandPool),
359 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall03b6fe12015-11-24 12:44:21 -0800360 if (!pool)
361 return VK_ERROR_OUT_OF_HOST_MEMORY;
362 pool->allocator = *allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800363 *cmd_pool = GetHandleToCommandPool(pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800364 return VK_SUCCESS;
365}
366
367void DestroyCommandPool(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800368 VkCommandPool cmd_pool,
369 const VkAllocationCallbacks* /*allocator*/) {
370 CommandPool* pool = GetCommandPoolFromHandle(cmd_pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800371 pool->allocator.pfnFree(pool->allocator.pUserData, pool);
372}
373
374// -----------------------------------------------------------------------------
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700375// CmdBuffer
376
Jesse Hall3fbc8562015-11-29 22:10:52 -0800377VkResult AllocateCommandBuffers(VkDevice /*device*/,
378 const VkCommandBufferAllocateInfo* alloc_info,
379 VkCommandBuffer* cmdbufs) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800380 VkResult result = VK_SUCCESS;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800381 CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800382 std::fill(cmdbufs, cmdbufs + alloc_info->bufferCount, nullptr);
383 for (uint32_t i = 0; i < alloc_info->bufferCount; i++) {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800384 cmdbufs[i] =
385 static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation(
386 pool.allocator.pUserData, sizeof(VkCommandBuffer_T),
387 alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallfbf97b02015-11-20 14:17:03 -0800388 if (!cmdbufs[i]) {
389 result = VK_ERROR_OUT_OF_HOST_MEMORY;
390 break;
391 }
392 cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
393 }
394 if (result != VK_SUCCESS) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800395 for (uint32_t i = 0; i < alloc_info->bufferCount; i++) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800396 if (!cmdbufs[i])
397 break;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800398 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800399 }
400 }
Jesse Hallfbf97b02015-11-20 14:17:03 -0800401 return result;
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700402}
403
Jesse Hall03b6fe12015-11-24 12:44:21 -0800404void FreeCommandBuffers(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800405 VkCommandPool cmd_pool,
Jesse Hallfbf97b02015-11-20 14:17:03 -0800406 uint32_t count,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800407 const VkCommandBuffer* cmdbufs) {
408 CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800409 for (uint32_t i = 0; i < count; i++)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800410 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700411}
412
413// -----------------------------------------------------------------------------
Jesse Hall2077ce02015-08-29 18:10:59 +0100414// DeviceMemory
415
416struct DeviceMemory {
417 typedef VkDeviceMemory HandleType;
418 VkDeviceSize size;
419 alignas(16) uint8_t data[0];
420};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800421DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory)
Jesse Hall2077ce02015-08-29 18:10:59 +0100422
Jesse Hall3fbc8562015-11-29 22:10:52 -0800423VkResult AllocateMemory(VkDevice device,
424 const VkMemoryAllocateInfo* alloc_info,
425 const VkAllocationCallbacks* allocator,
426 VkDeviceMemory* mem_handle) {
Jesse Hall2077ce02015-08-29 18:10:59 +0100427 if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize)
428 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800429 if (!allocator)
430 allocator = &device->allocator;
Jesse Hall2077ce02015-08-29 18:10:59 +0100431
Jesse Hall2077ce02015-08-29 18:10:59 +0100432 size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize);
Jesse Hall3fbc8562015-11-29 22:10:52 -0800433 DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation(
434 allocator->pUserData, size, alignof(DeviceMemory),
435 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall2077ce02015-08-29 18:10:59 +0100436 if (!mem)
437 return VK_ERROR_OUT_OF_HOST_MEMORY;
438 mem->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800439 *mem_handle = GetHandleToDeviceMemory(mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100440 return VK_SUCCESS;
441}
442
Jesse Hall03b6fe12015-11-24 12:44:21 -0800443void FreeMemory(VkDevice device,
444 VkDeviceMemory mem_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800445 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800446 if (!allocator)
447 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800448 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800449 allocator->pfnFree(allocator->pUserData, mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100450}
451
452VkResult MapMemory(VkDevice,
453 VkDeviceMemory mem_handle,
454 VkDeviceSize offset,
455 VkDeviceSize,
456 VkMemoryMapFlags,
457 void** out_ptr) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800458 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall2077ce02015-08-29 18:10:59 +0100459 *out_ptr = &mem->data[0] + offset;
460 return VK_SUCCESS;
461}
462
463// -----------------------------------------------------------------------------
Jesse Hallf6578742015-08-29 17:06:12 +0100464// Buffer
465
466struct Buffer {
467 typedef VkBuffer HandleType;
468 VkDeviceSize size;
469};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800470DEFINE_OBJECT_HANDLE_CONVERSION(Buffer)
Jesse Hallf6578742015-08-29 17:06:12 +0100471
472VkResult CreateBuffer(VkDevice device,
473 const VkBufferCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800474 const VkAllocationCallbacks* allocator,
Jesse Hallf6578742015-08-29 17:06:12 +0100475 VkBuffer* buffer_handle) {
Jesse Hallbde8ee32015-09-01 16:24:29 -0700476 ALOGW_IF(create_info->size > kMaxDeviceMemory,
477 "CreateBuffer: requested size 0x%" PRIx64
478 " exceeds max device memory size 0x%" PRIx64,
479 create_info->size, kMaxDeviceMemory);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800480 if (!allocator)
481 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800482 Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation(
483 allocator->pUserData, sizeof(Buffer), alignof(Buffer),
484 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallf6578742015-08-29 17:06:12 +0100485 if (!buffer)
486 return VK_ERROR_OUT_OF_HOST_MEMORY;
487 buffer->size = create_info->size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800488 *buffer_handle = GetHandleToBuffer(buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100489 return VK_SUCCESS;
490}
491
Jesse Hall606a54e2015-11-19 22:17:28 -0800492void GetBufferMemoryRequirements(VkDevice,
493 VkBuffer buffer_handle,
494 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800495 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hallf6578742015-08-29 17:06:12 +0100496 requirements->size = buffer->size;
497 requirements->alignment = 16; // allow fast Neon/SSE memcpy
498 requirements->memoryTypeBits = 0x1;
Jesse Hallf6578742015-08-29 17:06:12 +0100499}
500
Jesse Hall03b6fe12015-11-24 12:44:21 -0800501void DestroyBuffer(VkDevice device,
502 VkBuffer buffer_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800503 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800504 if (!allocator)
505 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800506 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800507 allocator->pfnFree(allocator->pUserData, buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100508}
509
510// -----------------------------------------------------------------------------
Jesse Hall85c05b62015-09-01 18:07:41 -0700511// Image
512
513struct Image {
514 typedef VkImage HandleType;
515 VkDeviceSize size;
516};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800517DEFINE_OBJECT_HANDLE_CONVERSION(Image)
Jesse Hall85c05b62015-09-01 18:07:41 -0700518
519VkResult CreateImage(VkDevice device,
520 const VkImageCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800521 const VkAllocationCallbacks* allocator,
Jesse Hall85c05b62015-09-01 18:07:41 -0700522 VkImage* image_handle) {
523 if (create_info->imageType != VK_IMAGE_TYPE_2D ||
524 create_info->format != VK_FORMAT_R8G8B8A8_UNORM ||
525 create_info->mipLevels != 1) {
526 ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u",
527 create_info->imageType, create_info->format,
528 create_info->mipLevels);
Jesse Halla15a4bf2015-11-19 22:48:02 -0800529 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall85c05b62015-09-01 18:07:41 -0700530 }
531
532 VkDeviceSize size =
533 VkDeviceSize(create_info->extent.width * create_info->extent.height) *
Jesse Halla15a4bf2015-11-19 22:48:02 -0800534 create_info->arrayLayers * create_info->samples * 4u;
Jesse Hall85c05b62015-09-01 18:07:41 -0700535 ALOGW_IF(size > kMaxDeviceMemory,
536 "CreateImage: image size 0x%" PRIx64
537 " exceeds max device memory size 0x%" PRIx64,
538 size, kMaxDeviceMemory);
539
Jesse Hall03b6fe12015-11-24 12:44:21 -0800540 if (!allocator)
541 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800542 Image* image = static_cast<Image*>(allocator->pfnAllocation(
543 allocator->pUserData, sizeof(Image), alignof(Image),
544 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall85c05b62015-09-01 18:07:41 -0700545 if (!image)
546 return VK_ERROR_OUT_OF_HOST_MEMORY;
547 image->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800548 *image_handle = GetHandleToImage(image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700549 return VK_SUCCESS;
550}
551
Jesse Hall606a54e2015-11-19 22:17:28 -0800552void GetImageMemoryRequirements(VkDevice,
553 VkImage image_handle,
554 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800555 Image* image = GetImageFromHandle(image_handle);
Jesse Hall85c05b62015-09-01 18:07:41 -0700556 requirements->size = image->size;
557 requirements->alignment = 16; // allow fast Neon/SSE memcpy
558 requirements->memoryTypeBits = 0x1;
Jesse Hall85c05b62015-09-01 18:07:41 -0700559}
560
Jesse Hall03b6fe12015-11-24 12:44:21 -0800561void DestroyImage(VkDevice device,
562 VkImage image_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800563 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800564 if (!allocator)
565 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800566 Image* image = GetImageFromHandle(image_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800567 allocator->pfnFree(allocator->pUserData, image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700568}
569
570// -----------------------------------------------------------------------------
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700571// No-op types
572
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700573VkResult CreateBufferView(VkDevice device,
574 const VkBufferViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800575 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700576 VkBufferView* view) {
577 *view = AllocHandle(device, HandleType::kBufferView);
578 return VK_SUCCESS;
579}
580
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700581VkResult CreateDescriptorPool(VkDevice device,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700582 const VkDescriptorPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800583 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700584 VkDescriptorPool* pool) {
585 *pool = AllocHandle(device, HandleType::kDescriptorPool);
586 return VK_SUCCESS;
587}
588
Jesse Hall3fbc8562015-11-29 22:10:52 -0800589VkResult AllocateDescriptorSets(VkDevice device,
590 const VkDescriptorSetAllocateInfo* alloc_info,
591 VkDescriptorSet* descriptor_sets) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800592 for (uint32_t i = 0; i < alloc_info->setLayoutCount; i++)
Jesse Hallfbf97b02015-11-20 14:17:03 -0800593 descriptor_sets[i] = AllocHandle(device, HandleType::kDescriptorSet);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700594 return VK_SUCCESS;
595}
596
597VkResult CreateDescriptorSetLayout(VkDevice device,
598 const VkDescriptorSetLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800599 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700600 VkDescriptorSetLayout* layout) {
601 *layout = AllocHandle(device, HandleType::kDescriptorSetLayout);
602 return VK_SUCCESS;
603}
604
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700605VkResult CreateEvent(VkDevice device,
606 const VkEventCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800607 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700608 VkEvent* event) {
609 *event = AllocHandle(device, HandleType::kEvent);
610 return VK_SUCCESS;
611}
612
613VkResult CreateFence(VkDevice device,
614 const VkFenceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800615 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700616 VkFence* fence) {
617 *fence = AllocHandle(device, HandleType::kFence);
618 return VK_SUCCESS;
619}
620
621VkResult CreateFramebuffer(VkDevice device,
622 const VkFramebufferCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800623 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700624 VkFramebuffer* framebuffer) {
625 *framebuffer = AllocHandle(device, HandleType::kFramebuffer);
626 return VK_SUCCESS;
627}
628
629VkResult CreateImageView(VkDevice device,
630 const VkImageViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800631 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700632 VkImageView* view) {
633 *view = AllocHandle(device, HandleType::kImageView);
634 return VK_SUCCESS;
635}
636
637VkResult CreateGraphicsPipelines(VkDevice device,
638 VkPipelineCache,
639 uint32_t count,
640 const VkGraphicsPipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800641 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700642 VkPipeline* pipelines) {
643 for (uint32_t i = 0; i < count; i++)
644 pipelines[i] = AllocHandle(device, HandleType::kPipeline);
645 return VK_SUCCESS;
646}
647
648VkResult CreateComputePipelines(VkDevice device,
649 VkPipelineCache,
650 uint32_t count,
651 const VkComputePipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800652 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700653 VkPipeline* pipelines) {
654 for (uint32_t i = 0; i < count; i++)
655 pipelines[i] = AllocHandle(device, HandleType::kPipeline);
656 return VK_SUCCESS;
657}
658
659VkResult CreatePipelineCache(VkDevice device,
660 const VkPipelineCacheCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800661 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700662 VkPipelineCache* cache) {
663 *cache = AllocHandle(device, HandleType::kPipelineCache);
664 return VK_SUCCESS;
665}
666
667VkResult CreatePipelineLayout(VkDevice device,
668 const VkPipelineLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800669 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700670 VkPipelineLayout* layout) {
671 *layout = AllocHandle(device, HandleType::kPipelineLayout);
672 return VK_SUCCESS;
673}
674
675VkResult CreateQueryPool(VkDevice device,
676 const VkQueryPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800677 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700678 VkQueryPool* pool) {
679 *pool = AllocHandle(device, HandleType::kQueryPool);
680 return VK_SUCCESS;
681}
682
683VkResult CreateRenderPass(VkDevice device,
684 const VkRenderPassCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800685 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700686 VkRenderPass* renderpass) {
687 *renderpass = AllocHandle(device, HandleType::kRenderPass);
688 return VK_SUCCESS;
689}
690
691VkResult CreateSampler(VkDevice device,
692 const VkSamplerCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800693 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700694 VkSampler* sampler) {
695 *sampler = AllocHandle(device, HandleType::kSampler);
696 return VK_SUCCESS;
697}
698
699VkResult CreateSemaphore(VkDevice device,
700 const VkSemaphoreCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800701 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700702 VkSemaphore* semaphore) {
703 *semaphore = AllocHandle(device, HandleType::kSemaphore);
704 return VK_SUCCESS;
705}
706
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700707VkResult CreateShaderModule(VkDevice device,
708 const VkShaderModuleCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800709 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700710 VkShaderModule* module) {
711 *module = AllocHandle(device, HandleType::kShaderModule);
712 return VK_SUCCESS;
713}
714
Jesse Hall70f93352015-11-04 09:41:31 -0800715VkResult GetSwapchainGrallocUsageANDROID(VkDevice,
716 VkFormat,
717 VkImageUsageFlags,
718 int* grallocUsage) {
719 // The null driver never reads or writes the gralloc buffer
720 *grallocUsage = 0;
721 return VK_SUCCESS;
722}
723
Jesse Hallab9aeef2015-11-04 10:56:20 -0800724VkResult AcquireImageANDROID(VkDevice, VkImage, int fence, VkSemaphore) {
Jesse Halld7b994a2015-09-07 14:17:37 -0700725 close(fence);
726 return VK_SUCCESS;
727}
728
Jesse Hallab9aeef2015-11-04 10:56:20 -0800729VkResult QueueSignalReleaseImageANDROID(VkQueue, VkImage, int* fence) {
Jesse Halld7b994a2015-09-07 14:17:37 -0700730 *fence = -1;
731 return VK_SUCCESS;
732}
733
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700734// -----------------------------------------------------------------------------
Jesse Hall04f4f472015-08-16 19:51:04 -0700735// No-op entrypoints
736
737// clang-format off
738#pragma clang diagnostic push
739#pragma clang diagnostic ignored "-Wunused-parameter"
740
Jesse Hall606a54e2015-11-19 22:17:28 -0800741void GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100742 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700743}
744
Jesse Hall606a54e2015-11-19 22:17:28 -0800745void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100746 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700747}
748
Jesse Halla9e57032015-11-30 01:03:10 -0800749VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100750 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Halla9e57032015-11-30 01:03:10 -0800751 return VK_SUCCESS;
Jesse Hall04f4f472015-08-16 19:51:04 -0700752}
753
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700754VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100755 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700756 return VK_SUCCESS;
757}
758
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700759VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100760 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700761 return VK_SUCCESS;
762}
763
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700764VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100765 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700766 return VK_SUCCESS;
767}
768
Jesse Halla366a512015-11-19 22:30:07 -0800769VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700770 return VK_SUCCESS;
771}
772
773VkResult QueueWaitIdle(VkQueue queue) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100774 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700775 return VK_SUCCESS;
776}
777
778VkResult DeviceWaitIdle(VkDevice device) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100779 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700780 return VK_SUCCESS;
781}
782
Jesse Hallcf25c412015-10-29 17:14:50 -0700783void UnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700784}
785
786VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100787 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700788 return VK_SUCCESS;
789}
790
791VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100792 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700793 return VK_SUCCESS;
794}
795
Jesse Hall606a54e2015-11-19 22:17:28 -0800796void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100797 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700798}
799
Jesse Hall04f4f472015-08-16 19:51:04 -0700800VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) {
801 return VK_SUCCESS;
802}
803
Jesse Hall04f4f472015-08-16 19:51:04 -0700804VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) {
805 return VK_SUCCESS;
806}
807
Jesse Hall606a54e2015-11-19 22:17:28 -0800808void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100809 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700810}
811
Jesse Hall091ed9e2015-11-30 00:55:29 -0800812void 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 +0100813 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700814}
815
Jesse Halla6429252015-11-29 18:59:42 -0800816VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100817 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700818 return VK_SUCCESS;
819}
820
Jesse Hall3fbc8562015-11-29 22:10:52 -0800821void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700822}
823
824VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
825 return VK_SUCCESS;
826}
827
828VkResult GetFenceStatus(VkDevice device, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100829 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700830 return VK_SUCCESS;
831}
832
833VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {
834 return VK_SUCCESS;
835}
836
Jesse Hall3fbc8562015-11-29 22:10:52 -0800837void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700838}
839
Jesse Hall3fbc8562015-11-29 22:10:52 -0800840void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700841}
842
843VkResult GetEventStatus(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100844 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700845 return VK_SUCCESS;
846}
847
848VkResult SetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100849 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700850 return VK_SUCCESS;
851}
852
853VkResult ResetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100854 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700855 return VK_SUCCESS;
856}
857
Jesse Hall3fbc8562015-11-29 22:10:52 -0800858void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700859}
860
Jesse Halla9bb62b2015-11-21 19:31:56 -0800861VkResult 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 +0100862 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700863 return VK_SUCCESS;
864}
865
Jesse Hall3fbc8562015-11-29 22:10:52 -0800866void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700867}
868
Jesse Hall606a54e2015-11-19 22:17:28 -0800869void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100870 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700871}
872
Jesse Hall3fbc8562015-11-29 22:10:52 -0800873void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700874}
875
Jesse Hall3fbc8562015-11-29 22:10:52 -0800876void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700877}
878
Jesse Hall3fbc8562015-11-29 22:10:52 -0800879void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700880}
881
Jesse Halla9bb62b2015-11-21 19:31:56 -0800882VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100883 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700884 return VK_SUCCESS;
885}
886
887VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100888 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700889 return VK_SUCCESS;
890}
891
Jesse Hall3fbc8562015-11-29 22:10:52 -0800892void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700893}
894
Jesse Hall3fbc8562015-11-29 22:10:52 -0800895void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700896}
897
Jesse Hall3fbc8562015-11-29 22:10:52 -0800898void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700899}
900
Jesse Hall3fbc8562015-11-29 22:10:52 -0800901void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700902}
903
Jesse Hall3fbc8562015-11-29 22:10:52 -0800904void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700905}
906
Jesse Hallfbf97b02015-11-20 14:17:03 -0800907VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100908 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700909 return VK_SUCCESS;
910}
911
Jesse Hallcf25c412015-10-29 17:14:50 -0700912void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100913 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700914}
915
916VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100917 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700918 return VK_SUCCESS;
919}
920
Jesse Hall3fbc8562015-11-29 22:10:52 -0800921void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700922}
923
Jesse Hall3fbc8562015-11-29 22:10:52 -0800924void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700925}
926
Jesse Hall606a54e2015-11-19 22:17:28 -0800927void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100928 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700929}
930
Jesse Hall3fbc8562015-11-29 22:10:52 -0800931VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100932 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700933 return VK_SUCCESS;
934}
935
Jesse Hall3fbc8562015-11-29 22:10:52 -0800936VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700937 return VK_SUCCESS;
938}
939
Jesse Hall3fbc8562015-11-29 22:10:52 -0800940VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700941 return VK_SUCCESS;
942}
943
Jesse Hall3fbc8562015-11-29 22:10:52 -0800944VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100945 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700946 return VK_SUCCESS;
947}
948
Jesse Hall3fbc8562015-11-29 22:10:52 -0800949void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700950}
951
Jesse Hall3fbc8562015-11-29 22:10:52 -0800952void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700953}
954
Jesse Hall3fbc8562015-11-29 22:10:52 -0800955void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700956}
957
Jesse Hall3fbc8562015-11-29 22:10:52 -0800958void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700959}
960
Jesse Hall3fbc8562015-11-29 22:10:52 -0800961void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700962}
963
Jesse Hall3fbc8562015-11-29 22:10:52 -0800964void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700965}
966
Jesse Hall3fbc8562015-11-29 22:10:52 -0800967void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700968}
969
Jesse Hall3fbc8562015-11-29 22:10:52 -0800970void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700971}
972
Jesse Hall3fbc8562015-11-29 22:10:52 -0800973void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700974}
975
Jesse Hall3fbc8562015-11-29 22:10:52 -0800976void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700977}
978
Jesse Hall3fbc8562015-11-29 22:10:52 -0800979void 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 -0700980}
981
Jesse Hall3fbc8562015-11-29 22:10:52 -0800982void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700983}
984
Jesse Hall3fbc8562015-11-29 22:10:52 -0800985void CmdBindVertexBuffers(VkCommandBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700986}
987
Jesse Hall3fbc8562015-11-29 22:10:52 -0800988void CmdDraw(VkCommandBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700989}
990
Jesse Hall3fbc8562015-11-29 22:10:52 -0800991void 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 -0700992}
993
Jesse Hall3fbc8562015-11-29 22:10:52 -0800994void CmdDrawIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700995}
996
Jesse Hall3fbc8562015-11-29 22:10:52 -0800997void CmdDrawIndexedIndirect(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 CmdDispatch(VkCommandBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001001}
1002
Jesse Hall3fbc8562015-11-29 22:10:52 -08001003void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001004}
1005
Jesse Hall3fbc8562015-11-29 22:10:52 -08001006void CmdCopyBuffer(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001007}
1008
Jesse Hall3fbc8562015-11-29 22:10:52 -08001009void CmdCopyImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001010}
1011
Jesse Hall3fbc8562015-11-29 22:10:52 -08001012void 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 -07001013}
1014
Jesse Hall3fbc8562015-11-29 22:10:52 -08001015void CmdCopyBufferToImage(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001016}
1017
Jesse Hall3fbc8562015-11-29 22:10:52 -08001018void CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001019}
1020
Jesse Hall3fbc8562015-11-29 22:10:52 -08001021void CmdUpdateBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001022}
1023
Jesse Hall3fbc8562015-11-29 22:10:52 -08001024void CmdFillBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001025}
1026
Jesse Hall3fbc8562015-11-29 22:10:52 -08001027void CmdClearColorImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001028}
1029
Jesse Hall3fbc8562015-11-29 22:10:52 -08001030void CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001031}
1032
Jesse Hall3fbc8562015-11-29 22:10:52 -08001033void CmdClearAttachments(VkCommandBuffer cmdBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001034}
1035
Jesse Hall3fbc8562015-11-29 22:10:52 -08001036void CmdResolveImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001037}
1038
Jesse Hall3fbc8562015-11-29 22:10:52 -08001039void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001040}
1041
Jesse Hall3fbc8562015-11-29 22:10:52 -08001042void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001043}
1044
Jesse Hall3fbc8562015-11-29 22:10:52 -08001045void CmdWaitEvents(VkCommandBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001046}
1047
Jesse Hall3fbc8562015-11-29 22:10:52 -08001048void CmdPipelineBarrier(VkCommandBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkDependencyFlags dependencyFlags, uint32_t memBarrierCount, const void* const* ppMemBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001049}
1050
Jesse Hall3fbc8562015-11-29 22:10:52 -08001051void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001052}
1053
Jesse Hall3fbc8562015-11-29 22:10:52 -08001054void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001055}
1056
Jesse Hall3fbc8562015-11-29 22:10:52 -08001057void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001058}
1059
Jesse Hall3fbc8562015-11-29 22:10:52 -08001060void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001061}
1062
Jesse Hall3fbc8562015-11-29 22:10:52 -08001063void 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 -07001064}
1065
Jesse Hall3fbc8562015-11-29 22:10:52 -08001066void CmdPushConstants(VkCommandBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001067}
1068
Jesse Hall65ab5522015-11-30 00:07:16 -08001069void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001070}
1071
Jesse Hall65ab5522015-11-30 00:07:16 -08001072void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001073}
1074
Jesse Hall3fbc8562015-11-29 22:10:52 -08001075void CmdEndRenderPass(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001076}
1077
Jesse Hall3fbc8562015-11-29 22:10:52 -08001078void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001079}
1080
Jesse Hall04f4f472015-08-16 19:51:04 -07001081#pragma clang diagnostic pop
1082// clang-format on
1083
1084} // namespace null_driver