blob: 4fd010308ad7c29f74df520bbf5c5222b66fdd8d [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 Halle1b12782015-11-30 11:27:32 -0800132VKAPI_ATTR
Jesse Hall03b6fe12015-11-24 12:44:21 -0800133VkResult CreateInstance(const VkInstanceCreateInfo* /*create_info*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800134 const VkAllocationCallbacks* allocator,
Jesse Hall04f4f472015-08-16 19:51:04 -0700135 VkInstance* out_instance) {
Jesse Hallb1352bc2015-09-04 16:12:33 -0700136 // Assume the loader provided alloc callbacks even if the app didn't.
137 ALOG_ASSERT(
Jesse Hall03b6fe12015-11-24 12:44:21 -0800138 allocator,
Jesse Hallb1352bc2015-09-04 16:12:33 -0700139 "Missing alloc callbacks, loader or app should have provided them");
140
Jesse Hall3fbc8562015-11-29 22:10:52 -0800141 VkInstance_T* instance =
142 static_cast<VkInstance_T*>(allocator->pfnAllocation(
143 allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T),
144 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE));
Jesse Hall04f4f472015-08-16 19:51:04 -0700145 if (!instance)
146 return VK_ERROR_OUT_OF_HOST_MEMORY;
147
148 instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800149 instance->allocator = *allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700150 instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
151
152 *out_instance = instance;
153 return VK_SUCCESS;
154}
155
156int CloseDevice(struct hw_device_t* /*device*/) {
157 // nothing to do - opening a device doesn't allocate any resources
158 return 0;
159}
160
161hwvulkan_device_t nulldrv_device = {
162 .common =
163 {
Michael Lentine03c64b02015-08-26 18:27:26 -0500164 .tag = HARDWARE_DEVICE_TAG,
165 .version = HWVULKAN_DEVICE_API_VERSION_0_1,
166 .module = &HAL_MODULE_INFO_SYM.common,
167 .close = CloseDevice,
Jesse Hall04f4f472015-08-16 19:51:04 -0700168 },
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700169 .EnumerateInstanceExtensionProperties =
170 EnumerateInstanceExtensionProperties,
Jesse Hall04f4f472015-08-16 19:51:04 -0700171 .CreateInstance = CreateInstance,
172 .GetInstanceProcAddr = GetInstanceProcAddr};
173
174int OpenDevice(const hw_module_t* /*module*/,
175 const char* id,
176 hw_device_t** device) {
177 if (strcmp(id, HWVULKAN_DEVICE_0) == 0) {
178 *device = &nulldrv_device.common;
179 return 0;
180 }
181 return -ENOENT;
182}
183
184VkInstance_T* GetInstanceFromPhysicalDevice(
185 VkPhysicalDevice_T* physical_device) {
186 return reinterpret_cast<VkInstance_T*>(
187 reinterpret_cast<uintptr_t>(physical_device) -
188 offsetof(VkInstance_T, physical_device));
189}
190
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700191uint64_t AllocHandle(VkDevice device, HandleType::Enum type) {
192 const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1;
193 ALOGE_IF(device->next_handle[type] == kHandleMask,
Jesse Hallbde8ee32015-09-01 16:24:29 -0700194 "non-dispatchable handles of type=%u are about to overflow", type);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700195 return (UINT64_C(1) << 63) | ((uint64_t(type) & 0x7) << 56) |
196 (device->next_handle[type]++ & kHandleMask);
197}
198
Jesse Hall04f4f472015-08-16 19:51:04 -0700199} // namespace
200
201namespace null_driver {
202
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800203#define DEFINE_OBJECT_HANDLE_CONVERSION(T) \
204 T* Get##T##FromHandle(Vk##T h); \
205 T* Get##T##FromHandle(Vk##T h) { \
206 return reinterpret_cast<T*>(uintptr_t(h)); \
207 } \
208 Vk##T GetHandleTo##T(const T* obj); \
209 Vk##T GetHandleTo##T(const T* obj) { \
210 return Vk##T(reinterpret_cast<uintptr_t>(obj)); \
211 }
Jesse Hallf6578742015-08-29 17:06:12 +0100212
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100213// -----------------------------------------------------------------------------
214// Global
215
Jesse Halle1b12782015-11-30 11:27:32 -0800216VKAPI_ATTR
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700217VkResult EnumerateInstanceExtensionProperties(const char*,
218 uint32_t* count,
219 VkExtensionProperties*) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100220 *count = 0;
221 return VK_SUCCESS;
222}
223
Jesse Halle1b12782015-11-30 11:27:32 -0800224VKAPI_ATTR
Jesse Hall04f4f472015-08-16 19:51:04 -0700225PFN_vkVoidFunction GetInstanceProcAddr(VkInstance, const char* name) {
226 PFN_vkVoidFunction proc = LookupInstanceProcAddr(name);
227 if (!proc && strcmp(name, "vkGetDeviceProcAddr") == 0)
228 proc = reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr);
229 return proc;
230}
231
Jesse Halle1b12782015-11-30 11:27:32 -0800232VKAPI_ATTR
Jesse Hall04f4f472015-08-16 19:51:04 -0700233PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) {
Jesse Hallb1352bc2015-09-04 16:12:33 -0700234 PFN_vkVoidFunction proc = LookupDeviceProcAddr(name);
235 if (proc)
236 return proc;
Jesse Hall70f93352015-11-04 09:41:31 -0800237 if (strcmp(name, "vkGetSwapchainGrallocUsageANDROID") == 0)
238 return reinterpret_cast<PFN_vkVoidFunction>(
239 GetSwapchainGrallocUsageANDROID);
Jesse Hallab9aeef2015-11-04 10:56:20 -0800240 if (strcmp(name, "vkAcquireImageANDROID") == 0)
241 return reinterpret_cast<PFN_vkVoidFunction>(AcquireImageANDROID);
242 if (strcmp(name, "vkQueueSignalReleaseImageANDROID") == 0)
Jesse Hallb1352bc2015-09-04 16:12:33 -0700243 return reinterpret_cast<PFN_vkVoidFunction>(
Jesse Hallab9aeef2015-11-04 10:56:20 -0800244 QueueSignalReleaseImageANDROID);
Jesse Hallb1352bc2015-09-04 16:12:33 -0700245 return nullptr;
Jesse Hall04f4f472015-08-16 19:51:04 -0700246}
247
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100248// -----------------------------------------------------------------------------
249// Instance
250
Jesse Hall03b6fe12015-11-24 12:44:21 -0800251void DestroyInstance(VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800252 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800253 instance->allocator.pfnFree(instance->allocator.pUserData, instance);
Jesse Hall04f4f472015-08-16 19:51:04 -0700254}
255
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100256// -----------------------------------------------------------------------------
257// PhysicalDevice
258
Jesse Hall04f4f472015-08-16 19:51:04 -0700259VkResult EnumeratePhysicalDevices(VkInstance instance,
260 uint32_t* physical_device_count,
261 VkPhysicalDevice* physical_devices) {
262 if (physical_devices && *physical_device_count >= 1)
263 physical_devices[0] = &instance->physical_device;
264 *physical_device_count = 1;
265 return VK_SUCCESS;
266}
267
Jesse Hall606a54e2015-11-19 22:17:28 -0800268void GetPhysicalDeviceProperties(VkPhysicalDevice,
269 VkPhysicalDeviceProperties* properties) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700270 properties->apiVersion = VK_API_VERSION;
271 properties->driverVersion = VK_MAKE_VERSION(0, 0, 1);
Jesse Hall65ab5522015-11-30 00:07:16 -0800272 properties->vendorID = 0;
273 properties->deviceID = 0;
Jesse Hall04f4f472015-08-16 19:51:04 -0700274 properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
275 strcpy(properties->deviceName, "Android Vulkan Null Driver");
276 memset(properties->pipelineCacheUUID, 0,
277 sizeof(properties->pipelineCacheUUID));
Jesse Hall04f4f472015-08-16 19:51:04 -0700278}
279
Jesse Hall606a54e2015-11-19 22:17:28 -0800280void GetPhysicalDeviceQueueFamilyProperties(
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700281 VkPhysicalDevice,
282 uint32_t* count,
283 VkQueueFamilyProperties* properties) {
284 if (properties) {
Jesse Hall65ab5522015-11-30 00:07:16 -0800285 properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT |
286 VK_QUEUE_TRANSFER_BIT;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700287 properties->queueCount = 1;
Jesse Hallacfa5342015-11-19 21:51:33 -0800288 properties->timestampValidBits = 64;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700289 }
290 *count = 1;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700291}
292
Jesse Hall606a54e2015-11-19 22:17:28 -0800293void GetPhysicalDeviceMemoryProperties(
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100294 VkPhysicalDevice,
295 VkPhysicalDeviceMemoryProperties* properties) {
296 properties->memoryTypeCount = 1;
297 properties->memoryTypes[0].propertyFlags =
Jesse Halld1af8122015-11-29 23:50:38 -0800298 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
299 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
300 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
301 VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100302 properties->memoryTypes[0].heapIndex = 0;
303 properties->memoryHeapCount = 1;
Jesse Hallbde8ee32015-09-01 16:24:29 -0700304 properties->memoryHeaps[0].size = kMaxDeviceMemory;
Jesse Halld1af8122015-11-29 23:50:38 -0800305 properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
Jesse Hall04f4f472015-08-16 19:51:04 -0700306}
307
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100308// -----------------------------------------------------------------------------
309// Device
310
Jesse Hall04f4f472015-08-16 19:51:04 -0700311VkResult CreateDevice(VkPhysicalDevice physical_device,
312 const VkDeviceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800313 const VkAllocationCallbacks* allocator,
Jesse Hall04f4f472015-08-16 19:51:04 -0700314 VkDevice* out_device) {
315 VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800316 if (!allocator)
317 allocator = &instance->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800318 VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation(
319 allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T),
320 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE));
Jesse Hall04f4f472015-08-16 19:51:04 -0700321 if (!device)
322 return VK_ERROR_OUT_OF_HOST_MEMORY;
323
324 device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800325 device->allocator = *allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700326 device->instance = instance;
327 device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700328 std::fill(device->next_handle.begin(), device->next_handle.end(),
329 UINT64_C(0));
Jesse Hall04f4f472015-08-16 19:51:04 -0700330
331 *out_device = device;
332 return VK_SUCCESS;
333}
334
Jesse Hall3fbc8562015-11-29 22:10:52 -0800335void DestroyDevice(VkDevice device,
336 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700337 if (!device)
Jesse Hallcf25c412015-10-29 17:14:50 -0700338 return;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800339 device->allocator.pfnFree(device->allocator.pUserData, device);
Jesse Hall04f4f472015-08-16 19:51:04 -0700340}
341
Jesse Hall606a54e2015-11-19 22:17:28 -0800342void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700343 *queue = &device->queue;
Jesse Hall04f4f472015-08-16 19:51:04 -0700344}
345
346// -----------------------------------------------------------------------------
Jesse Hall3fbc8562015-11-29 22:10:52 -0800347// CommandPool
Jesse Hall03b6fe12015-11-24 12:44:21 -0800348
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349struct CommandPool {
350 typedef VkCommandPool HandleType;
351 VkAllocationCallbacks allocator;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800352};
Jesse Hall3fbc8562015-11-29 22:10:52 -0800353DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800354
355VkResult CreateCommandPool(VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800356 const VkCommandPoolCreateInfo* /*create_info*/,
357 const VkAllocationCallbacks* allocator,
358 VkCommandPool* cmd_pool) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800359 if (!allocator)
360 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800361 CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation(
362 allocator->pUserData, sizeof(CommandPool), alignof(CommandPool),
363 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall03b6fe12015-11-24 12:44:21 -0800364 if (!pool)
365 return VK_ERROR_OUT_OF_HOST_MEMORY;
366 pool->allocator = *allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800367 *cmd_pool = GetHandleToCommandPool(pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800368 return VK_SUCCESS;
369}
370
371void DestroyCommandPool(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800372 VkCommandPool cmd_pool,
373 const VkAllocationCallbacks* /*allocator*/) {
374 CommandPool* pool = GetCommandPoolFromHandle(cmd_pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800375 pool->allocator.pfnFree(pool->allocator.pUserData, pool);
376}
377
378// -----------------------------------------------------------------------------
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700379// CmdBuffer
380
Jesse Hall3fbc8562015-11-29 22:10:52 -0800381VkResult AllocateCommandBuffers(VkDevice /*device*/,
382 const VkCommandBufferAllocateInfo* alloc_info,
383 VkCommandBuffer* cmdbufs) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800384 VkResult result = VK_SUCCESS;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800385 CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800386 std::fill(cmdbufs, cmdbufs + alloc_info->bufferCount, nullptr);
387 for (uint32_t i = 0; i < alloc_info->bufferCount; i++) {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800388 cmdbufs[i] =
389 static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation(
390 pool.allocator.pUserData, sizeof(VkCommandBuffer_T),
391 alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallfbf97b02015-11-20 14:17:03 -0800392 if (!cmdbufs[i]) {
393 result = VK_ERROR_OUT_OF_HOST_MEMORY;
394 break;
395 }
396 cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
397 }
398 if (result != VK_SUCCESS) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800399 for (uint32_t i = 0; i < alloc_info->bufferCount; i++) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800400 if (!cmdbufs[i])
401 break;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800402 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800403 }
404 }
Jesse Hallfbf97b02015-11-20 14:17:03 -0800405 return result;
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700406}
407
Jesse Hall03b6fe12015-11-24 12:44:21 -0800408void FreeCommandBuffers(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800409 VkCommandPool cmd_pool,
Jesse Hallfbf97b02015-11-20 14:17:03 -0800410 uint32_t count,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800411 const VkCommandBuffer* cmdbufs) {
412 CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800413 for (uint32_t i = 0; i < count; i++)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800414 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700415}
416
417// -----------------------------------------------------------------------------
Jesse Hall2077ce02015-08-29 18:10:59 +0100418// DeviceMemory
419
420struct DeviceMemory {
421 typedef VkDeviceMemory HandleType;
422 VkDeviceSize size;
423 alignas(16) uint8_t data[0];
424};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800425DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory)
Jesse Hall2077ce02015-08-29 18:10:59 +0100426
Jesse Hall3fbc8562015-11-29 22:10:52 -0800427VkResult AllocateMemory(VkDevice device,
428 const VkMemoryAllocateInfo* alloc_info,
429 const VkAllocationCallbacks* allocator,
430 VkDeviceMemory* mem_handle) {
Jesse Hall2077ce02015-08-29 18:10:59 +0100431 if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize)
432 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800433 if (!allocator)
434 allocator = &device->allocator;
Jesse Hall2077ce02015-08-29 18:10:59 +0100435
Jesse Hall2077ce02015-08-29 18:10:59 +0100436 size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize);
Jesse Hall3fbc8562015-11-29 22:10:52 -0800437 DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation(
438 allocator->pUserData, size, alignof(DeviceMemory),
439 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall2077ce02015-08-29 18:10:59 +0100440 if (!mem)
441 return VK_ERROR_OUT_OF_HOST_MEMORY;
442 mem->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800443 *mem_handle = GetHandleToDeviceMemory(mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100444 return VK_SUCCESS;
445}
446
Jesse Hall03b6fe12015-11-24 12:44:21 -0800447void FreeMemory(VkDevice device,
448 VkDeviceMemory mem_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800449 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800450 if (!allocator)
451 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800452 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800453 allocator->pfnFree(allocator->pUserData, mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100454}
455
456VkResult MapMemory(VkDevice,
457 VkDeviceMemory mem_handle,
458 VkDeviceSize offset,
459 VkDeviceSize,
460 VkMemoryMapFlags,
461 void** out_ptr) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800462 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall2077ce02015-08-29 18:10:59 +0100463 *out_ptr = &mem->data[0] + offset;
464 return VK_SUCCESS;
465}
466
467// -----------------------------------------------------------------------------
Jesse Hallf6578742015-08-29 17:06:12 +0100468// Buffer
469
470struct Buffer {
471 typedef VkBuffer HandleType;
472 VkDeviceSize size;
473};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800474DEFINE_OBJECT_HANDLE_CONVERSION(Buffer)
Jesse Hallf6578742015-08-29 17:06:12 +0100475
476VkResult CreateBuffer(VkDevice device,
477 const VkBufferCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800478 const VkAllocationCallbacks* allocator,
Jesse Hallf6578742015-08-29 17:06:12 +0100479 VkBuffer* buffer_handle) {
Jesse Hallbde8ee32015-09-01 16:24:29 -0700480 ALOGW_IF(create_info->size > kMaxDeviceMemory,
481 "CreateBuffer: requested size 0x%" PRIx64
482 " exceeds max device memory size 0x%" PRIx64,
483 create_info->size, kMaxDeviceMemory);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800484 if (!allocator)
485 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800486 Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation(
487 allocator->pUserData, sizeof(Buffer), alignof(Buffer),
488 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallf6578742015-08-29 17:06:12 +0100489 if (!buffer)
490 return VK_ERROR_OUT_OF_HOST_MEMORY;
491 buffer->size = create_info->size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800492 *buffer_handle = GetHandleToBuffer(buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100493 return VK_SUCCESS;
494}
495
Jesse Hall606a54e2015-11-19 22:17:28 -0800496void GetBufferMemoryRequirements(VkDevice,
497 VkBuffer buffer_handle,
498 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800499 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hallf6578742015-08-29 17:06:12 +0100500 requirements->size = buffer->size;
501 requirements->alignment = 16; // allow fast Neon/SSE memcpy
502 requirements->memoryTypeBits = 0x1;
Jesse Hallf6578742015-08-29 17:06:12 +0100503}
504
Jesse Hall03b6fe12015-11-24 12:44:21 -0800505void DestroyBuffer(VkDevice device,
506 VkBuffer buffer_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800507 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800508 if (!allocator)
509 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800510 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800511 allocator->pfnFree(allocator->pUserData, buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100512}
513
514// -----------------------------------------------------------------------------
Jesse Hall85c05b62015-09-01 18:07:41 -0700515// Image
516
517struct Image {
518 typedef VkImage HandleType;
519 VkDeviceSize size;
520};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800521DEFINE_OBJECT_HANDLE_CONVERSION(Image)
Jesse Hall85c05b62015-09-01 18:07:41 -0700522
523VkResult CreateImage(VkDevice device,
524 const VkImageCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800525 const VkAllocationCallbacks* allocator,
Jesse Hall85c05b62015-09-01 18:07:41 -0700526 VkImage* image_handle) {
527 if (create_info->imageType != VK_IMAGE_TYPE_2D ||
528 create_info->format != VK_FORMAT_R8G8B8A8_UNORM ||
529 create_info->mipLevels != 1) {
530 ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u",
531 create_info->imageType, create_info->format,
532 create_info->mipLevels);
Jesse Halla15a4bf2015-11-19 22:48:02 -0800533 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall85c05b62015-09-01 18:07:41 -0700534 }
535
536 VkDeviceSize size =
537 VkDeviceSize(create_info->extent.width * create_info->extent.height) *
Jesse Halla15a4bf2015-11-19 22:48:02 -0800538 create_info->arrayLayers * create_info->samples * 4u;
Jesse Hall85c05b62015-09-01 18:07:41 -0700539 ALOGW_IF(size > kMaxDeviceMemory,
540 "CreateImage: image size 0x%" PRIx64
541 " exceeds max device memory size 0x%" PRIx64,
542 size, kMaxDeviceMemory);
543
Jesse Hall03b6fe12015-11-24 12:44:21 -0800544 if (!allocator)
545 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800546 Image* image = static_cast<Image*>(allocator->pfnAllocation(
547 allocator->pUserData, sizeof(Image), alignof(Image),
548 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall85c05b62015-09-01 18:07:41 -0700549 if (!image)
550 return VK_ERROR_OUT_OF_HOST_MEMORY;
551 image->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800552 *image_handle = GetHandleToImage(image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700553 return VK_SUCCESS;
554}
555
Jesse Hall606a54e2015-11-19 22:17:28 -0800556void GetImageMemoryRequirements(VkDevice,
557 VkImage image_handle,
558 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800559 Image* image = GetImageFromHandle(image_handle);
Jesse Hall85c05b62015-09-01 18:07:41 -0700560 requirements->size = image->size;
561 requirements->alignment = 16; // allow fast Neon/SSE memcpy
562 requirements->memoryTypeBits = 0x1;
Jesse Hall85c05b62015-09-01 18:07:41 -0700563}
564
Jesse Hall03b6fe12015-11-24 12:44:21 -0800565void DestroyImage(VkDevice device,
566 VkImage image_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800567 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800568 if (!allocator)
569 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800570 Image* image = GetImageFromHandle(image_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800571 allocator->pfnFree(allocator->pUserData, image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700572}
573
574// -----------------------------------------------------------------------------
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700575// No-op types
576
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700577VkResult CreateBufferView(VkDevice device,
578 const VkBufferViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800579 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700580 VkBufferView* view) {
581 *view = AllocHandle(device, HandleType::kBufferView);
582 return VK_SUCCESS;
583}
584
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700585VkResult CreateDescriptorPool(VkDevice device,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700586 const VkDescriptorPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800587 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700588 VkDescriptorPool* pool) {
589 *pool = AllocHandle(device, HandleType::kDescriptorPool);
590 return VK_SUCCESS;
591}
592
Jesse Hall3fbc8562015-11-29 22:10:52 -0800593VkResult AllocateDescriptorSets(VkDevice device,
594 const VkDescriptorSetAllocateInfo* alloc_info,
595 VkDescriptorSet* descriptor_sets) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800596 for (uint32_t i = 0; i < alloc_info->setLayoutCount; i++)
Jesse Hallfbf97b02015-11-20 14:17:03 -0800597 descriptor_sets[i] = AllocHandle(device, HandleType::kDescriptorSet);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700598 return VK_SUCCESS;
599}
600
601VkResult CreateDescriptorSetLayout(VkDevice device,
602 const VkDescriptorSetLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800603 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700604 VkDescriptorSetLayout* layout) {
605 *layout = AllocHandle(device, HandleType::kDescriptorSetLayout);
606 return VK_SUCCESS;
607}
608
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700609VkResult CreateEvent(VkDevice device,
610 const VkEventCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800611 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700612 VkEvent* event) {
613 *event = AllocHandle(device, HandleType::kEvent);
614 return VK_SUCCESS;
615}
616
617VkResult CreateFence(VkDevice device,
618 const VkFenceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800619 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700620 VkFence* fence) {
621 *fence = AllocHandle(device, HandleType::kFence);
622 return VK_SUCCESS;
623}
624
625VkResult CreateFramebuffer(VkDevice device,
626 const VkFramebufferCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800627 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700628 VkFramebuffer* framebuffer) {
629 *framebuffer = AllocHandle(device, HandleType::kFramebuffer);
630 return VK_SUCCESS;
631}
632
633VkResult CreateImageView(VkDevice device,
634 const VkImageViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800635 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700636 VkImageView* view) {
637 *view = AllocHandle(device, HandleType::kImageView);
638 return VK_SUCCESS;
639}
640
641VkResult CreateGraphicsPipelines(VkDevice device,
642 VkPipelineCache,
643 uint32_t count,
644 const VkGraphicsPipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800645 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700646 VkPipeline* pipelines) {
647 for (uint32_t i = 0; i < count; i++)
648 pipelines[i] = AllocHandle(device, HandleType::kPipeline);
649 return VK_SUCCESS;
650}
651
652VkResult CreateComputePipelines(VkDevice device,
653 VkPipelineCache,
654 uint32_t count,
655 const VkComputePipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800656 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700657 VkPipeline* pipelines) {
658 for (uint32_t i = 0; i < count; i++)
659 pipelines[i] = AllocHandle(device, HandleType::kPipeline);
660 return VK_SUCCESS;
661}
662
663VkResult CreatePipelineCache(VkDevice device,
664 const VkPipelineCacheCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800665 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700666 VkPipelineCache* cache) {
667 *cache = AllocHandle(device, HandleType::kPipelineCache);
668 return VK_SUCCESS;
669}
670
671VkResult CreatePipelineLayout(VkDevice device,
672 const VkPipelineLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800673 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700674 VkPipelineLayout* layout) {
675 *layout = AllocHandle(device, HandleType::kPipelineLayout);
676 return VK_SUCCESS;
677}
678
679VkResult CreateQueryPool(VkDevice device,
680 const VkQueryPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800681 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700682 VkQueryPool* pool) {
683 *pool = AllocHandle(device, HandleType::kQueryPool);
684 return VK_SUCCESS;
685}
686
687VkResult CreateRenderPass(VkDevice device,
688 const VkRenderPassCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800689 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700690 VkRenderPass* renderpass) {
691 *renderpass = AllocHandle(device, HandleType::kRenderPass);
692 return VK_SUCCESS;
693}
694
695VkResult CreateSampler(VkDevice device,
696 const VkSamplerCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800697 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700698 VkSampler* sampler) {
699 *sampler = AllocHandle(device, HandleType::kSampler);
700 return VK_SUCCESS;
701}
702
703VkResult CreateSemaphore(VkDevice device,
704 const VkSemaphoreCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800705 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700706 VkSemaphore* semaphore) {
707 *semaphore = AllocHandle(device, HandleType::kSemaphore);
708 return VK_SUCCESS;
709}
710
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700711VkResult CreateShaderModule(VkDevice device,
712 const VkShaderModuleCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800713 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700714 VkShaderModule* module) {
715 *module = AllocHandle(device, HandleType::kShaderModule);
716 return VK_SUCCESS;
717}
718
Jesse Hall70f93352015-11-04 09:41:31 -0800719VkResult GetSwapchainGrallocUsageANDROID(VkDevice,
720 VkFormat,
721 VkImageUsageFlags,
722 int* grallocUsage) {
723 // The null driver never reads or writes the gralloc buffer
724 *grallocUsage = 0;
725 return VK_SUCCESS;
726}
727
Jesse Hallab9aeef2015-11-04 10:56:20 -0800728VkResult AcquireImageANDROID(VkDevice, VkImage, int fence, VkSemaphore) {
Jesse Halld7b994a2015-09-07 14:17:37 -0700729 close(fence);
730 return VK_SUCCESS;
731}
732
Jesse Hallab9aeef2015-11-04 10:56:20 -0800733VkResult QueueSignalReleaseImageANDROID(VkQueue, VkImage, int* fence) {
Jesse Halld7b994a2015-09-07 14:17:37 -0700734 *fence = -1;
735 return VK_SUCCESS;
736}
737
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700738// -----------------------------------------------------------------------------
Jesse Hall04f4f472015-08-16 19:51:04 -0700739// No-op entrypoints
740
741// clang-format off
742#pragma clang diagnostic push
743#pragma clang diagnostic ignored "-Wunused-parameter"
744
Jesse Hall606a54e2015-11-19 22:17:28 -0800745void GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100746 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700747}
748
Jesse Hall606a54e2015-11-19 22:17:28 -0800749void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100750 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700751}
752
Jesse Halla9e57032015-11-30 01:03:10 -0800753VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100754 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Halla9e57032015-11-30 01:03:10 -0800755 return VK_SUCCESS;
Jesse Hall04f4f472015-08-16 19:51:04 -0700756}
757
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700758VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100759 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700760 return VK_SUCCESS;
761}
762
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700763VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100764 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700765 return VK_SUCCESS;
766}
767
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700768VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100769 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700770 return VK_SUCCESS;
771}
772
Jesse Halla366a512015-11-19 22:30:07 -0800773VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700774 return VK_SUCCESS;
775}
776
777VkResult QueueWaitIdle(VkQueue queue) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100778 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700779 return VK_SUCCESS;
780}
781
782VkResult DeviceWaitIdle(VkDevice device) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100783 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700784 return VK_SUCCESS;
785}
786
Jesse Hallcf25c412015-10-29 17:14:50 -0700787void UnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700788}
789
790VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100791 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700792 return VK_SUCCESS;
793}
794
795VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100796 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700797 return VK_SUCCESS;
798}
799
Jesse Hall606a54e2015-11-19 22:17:28 -0800800void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100801 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700802}
803
Jesse Hall04f4f472015-08-16 19:51:04 -0700804VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) {
805 return VK_SUCCESS;
806}
807
Jesse Hall04f4f472015-08-16 19:51:04 -0700808VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) {
809 return VK_SUCCESS;
810}
811
Jesse Hall606a54e2015-11-19 22:17:28 -0800812void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100813 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700814}
815
Jesse Hall091ed9e2015-11-30 00:55:29 -0800816void 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 +0100817 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700818}
819
Jesse Halla6429252015-11-29 18:59:42 -0800820VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100821 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700822 return VK_SUCCESS;
823}
824
Jesse Hall3fbc8562015-11-29 22:10:52 -0800825void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700826}
827
828VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
829 return VK_SUCCESS;
830}
831
832VkResult GetFenceStatus(VkDevice device, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100833 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700834 return VK_SUCCESS;
835}
836
837VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {
838 return VK_SUCCESS;
839}
840
Jesse Hall3fbc8562015-11-29 22:10:52 -0800841void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700842}
843
Jesse Hall3fbc8562015-11-29 22:10:52 -0800844void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700845}
846
847VkResult GetEventStatus(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100848 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700849 return VK_SUCCESS;
850}
851
852VkResult SetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100853 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700854 return VK_SUCCESS;
855}
856
857VkResult ResetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100858 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700859 return VK_SUCCESS;
860}
861
Jesse Hall3fbc8562015-11-29 22:10:52 -0800862void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700863}
864
Jesse Halla9bb62b2015-11-21 19:31:56 -0800865VkResult 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 +0100866 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700867 return VK_SUCCESS;
868}
869
Jesse Hall3fbc8562015-11-29 22:10:52 -0800870void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700871}
872
Jesse Hall606a54e2015-11-19 22:17:28 -0800873void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100874 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700875}
876
Jesse Hall3fbc8562015-11-29 22:10:52 -0800877void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700878}
879
Jesse Hall3fbc8562015-11-29 22:10:52 -0800880void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700881}
882
Jesse Hall3fbc8562015-11-29 22:10:52 -0800883void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700884}
885
Jesse Halla9bb62b2015-11-21 19:31:56 -0800886VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100887 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700888 return VK_SUCCESS;
889}
890
891VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100892 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700893 return VK_SUCCESS;
894}
895
Jesse Hall3fbc8562015-11-29 22:10:52 -0800896void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700897}
898
Jesse Hall3fbc8562015-11-29 22:10:52 -0800899void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700900}
901
Jesse Hall3fbc8562015-11-29 22:10:52 -0800902void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700903}
904
Jesse Hall3fbc8562015-11-29 22:10:52 -0800905void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700906}
907
Jesse Hall3fbc8562015-11-29 22:10:52 -0800908void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700909}
910
Jesse Hallfbf97b02015-11-20 14:17:03 -0800911VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100912 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700913 return VK_SUCCESS;
914}
915
Jesse Hallcf25c412015-10-29 17:14:50 -0700916void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100917 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700918}
919
920VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100921 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700922 return VK_SUCCESS;
923}
924
Jesse Hall3fbc8562015-11-29 22:10:52 -0800925void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700926}
927
Jesse Hall3fbc8562015-11-29 22:10:52 -0800928void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700929}
930
Jesse Hall606a54e2015-11-19 22:17:28 -0800931void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100932 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700933}
934
Jesse Hall3fbc8562015-11-29 22:10:52 -0800935VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100936 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700937 return VK_SUCCESS;
938}
939
Jesse Hall3fbc8562015-11-29 22:10:52 -0800940VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700941 return VK_SUCCESS;
942}
943
Jesse Hall3fbc8562015-11-29 22:10:52 -0800944VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700945 return VK_SUCCESS;
946}
947
Jesse Hall3fbc8562015-11-29 22:10:52 -0800948VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100949 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -0700950 return VK_SUCCESS;
951}
952
Jesse Hall3fbc8562015-11-29 22:10:52 -0800953void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700954}
955
Jesse Hall3fbc8562015-11-29 22:10:52 -0800956void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700957}
958
Jesse Hall3fbc8562015-11-29 22:10:52 -0800959void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700960}
961
Jesse Hall3fbc8562015-11-29 22:10:52 -0800962void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700963}
964
Jesse Hall3fbc8562015-11-29 22:10:52 -0800965void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700966}
967
Jesse Hall3fbc8562015-11-29 22:10:52 -0800968void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700969}
970
Jesse Hall3fbc8562015-11-29 22:10:52 -0800971void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700972}
973
Jesse Hall3fbc8562015-11-29 22:10:52 -0800974void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700975}
976
Jesse Hall3fbc8562015-11-29 22:10:52 -0800977void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700978}
979
Jesse Hall3fbc8562015-11-29 22:10:52 -0800980void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700981}
982
Jesse Hall3fbc8562015-11-29 22:10:52 -0800983void 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 -0700984}
985
Jesse Hall3fbc8562015-11-29 22:10:52 -0800986void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700987}
988
Jesse Hall3fbc8562015-11-29 22:10:52 -0800989void CmdBindVertexBuffers(VkCommandBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700990}
991
Jesse Hall3fbc8562015-11-29 22:10:52 -0800992void CmdDraw(VkCommandBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700993}
994
Jesse Hall3fbc8562015-11-29 22:10:52 -0800995void 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 -0700996}
997
Jesse Hall3fbc8562015-11-29 22:10:52 -0800998void CmdDrawIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700999}
1000
Jesse Hall3fbc8562015-11-29 22:10:52 -08001001void CmdDrawIndexedIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001002}
1003
Jesse Hall3fbc8562015-11-29 22:10:52 -08001004void CmdDispatch(VkCommandBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001005}
1006
Jesse Hall3fbc8562015-11-29 22:10:52 -08001007void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001008}
1009
Jesse Hall3fbc8562015-11-29 22:10:52 -08001010void CmdCopyBuffer(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001011}
1012
Jesse Hall3fbc8562015-11-29 22:10:52 -08001013void CmdCopyImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001014}
1015
Jesse Hall3fbc8562015-11-29 22:10:52 -08001016void 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 -07001017}
1018
Jesse Hall3fbc8562015-11-29 22:10:52 -08001019void CmdCopyBufferToImage(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001020}
1021
Jesse Hall3fbc8562015-11-29 22:10:52 -08001022void CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001023}
1024
Jesse Hall3fbc8562015-11-29 22:10:52 -08001025void CmdUpdateBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001026}
1027
Jesse Hall3fbc8562015-11-29 22:10:52 -08001028void CmdFillBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001029}
1030
Jesse Hall3fbc8562015-11-29 22:10:52 -08001031void CmdClearColorImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001032}
1033
Jesse Hall3fbc8562015-11-29 22:10:52 -08001034void CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001035}
1036
Jesse Hall3fbc8562015-11-29 22:10:52 -08001037void CmdClearAttachments(VkCommandBuffer cmdBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001038}
1039
Jesse Hall3fbc8562015-11-29 22:10:52 -08001040void CmdResolveImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001041}
1042
Jesse Hall3fbc8562015-11-29 22:10:52 -08001043void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001044}
1045
Jesse Hall3fbc8562015-11-29 22:10:52 -08001046void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001047}
1048
Jesse Hall3fbc8562015-11-29 22:10:52 -08001049void 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 -07001050}
1051
Jesse Hall3fbc8562015-11-29 22:10:52 -08001052void CmdPipelineBarrier(VkCommandBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkDependencyFlags dependencyFlags, uint32_t memBarrierCount, const void* const* ppMemBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001053}
1054
Jesse Hall3fbc8562015-11-29 22:10:52 -08001055void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001056}
1057
Jesse Hall3fbc8562015-11-29 22:10:52 -08001058void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001059}
1060
Jesse Hall3fbc8562015-11-29 22:10:52 -08001061void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001062}
1063
Jesse Hall3fbc8562015-11-29 22:10:52 -08001064void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001065}
1066
Jesse Hall3fbc8562015-11-29 22:10:52 -08001067void 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 -07001068}
1069
Jesse Hall3fbc8562015-11-29 22:10:52 -08001070void CmdPushConstants(VkCommandBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001071}
1072
Jesse Hall65ab5522015-11-30 00:07:16 -08001073void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001074}
1075
Jesse Hall65ab5522015-11-30 00:07:16 -08001076void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001077}
1078
Jesse Hall3fbc8562015-11-29 22:10:52 -08001079void CmdEndRenderPass(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001080}
1081
Jesse Hall3fbc8562015-11-29 22:10:52 -08001082void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001083}
1084
Jesse Hall04f4f472015-08-16 19:51:04 -07001085#pragma clang diagnostic pop
1086// clang-format on
1087
1088} // namespace null_driver