blob: c701d48c2260772d4d8d3fc44802761907741086 [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
Dan Albert09dc47b2017-10-12 13:27:37 -070019#include <errno.h>
Jesse Hall715b86a2016-01-16 16:34:29 -080020#include <inttypes.h>
Jesse Halld3b14502016-04-20 16:58:11 -070021#include <stdlib.h>
Jesse Hall715b86a2016-01-16 16:34:29 -080022#include <string.h>
Steven Moreland54409a32017-07-17 11:49:21 -070023#include <unistd.h>
Jesse Hall04f4f472015-08-16 19:51:04 -070024
Mark Salyzyna5e161b2016-09-29 08:08:05 -070025#include <algorithm>
26#include <array>
27
Mark Salyzyn7823e122016-09-29 08:08:05 -070028#include <log/log.h>
Jesse Hall04f4f472015-08-16 19:51:04 -070029
Jesse Hall1f91d392015-12-11 16:28:44 -080030#include "null_driver_gen.h"
Jesse Hall04f4f472015-08-16 19:51:04 -070031
32using namespace null_driver;
33
34struct VkPhysicalDevice_T {
35 hwvulkan_dispatch_t dispatch;
36};
37
38struct VkInstance_T {
39 hwvulkan_dispatch_t dispatch;
Jesse Hall3fbc8562015-11-29 22:10:52 -080040 VkAllocationCallbacks allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -070041 VkPhysicalDevice_T physical_device;
Jesse Hall715b86a2016-01-16 16:34:29 -080042 uint64_t next_callback_handle;
Jesse Hall04f4f472015-08-16 19:51:04 -070043};
44
45struct VkQueue_T {
46 hwvulkan_dispatch_t dispatch;
47};
48
Jesse Hall3fbc8562015-11-29 22:10:52 -080049struct VkCommandBuffer_T {
Jesse Hall04f4f472015-08-16 19:51:04 -070050 hwvulkan_dispatch_t dispatch;
51};
52
Jesse Hallf8faf0c2015-08-31 11:34:32 -070053namespace {
54// Handles for non-dispatchable objects are either pointers, or arbitrary
55// 64-bit non-zero values. We only use pointers when we need to keep state for
56// the object even in a null driver. For the rest, we form a handle as:
57// [63:63] = 1 to distinguish from pointer handles*
58// [62:56] = non-zero handle type enum value
59// [55: 0] = per-handle-type incrementing counter
60// * This works because virtual addresses with the high bit set are reserved
61// for kernel data in all ABIs we run on.
62//
63// We never reclaim handles on vkDestroy*. It's not even necessary for us to
64// have distinct handles for live objects, and practically speaking we won't
65// ever create 2^56 objects of the same type from a single VkDevice in a null
66// driver.
67//
68// Using a namespace here instead of 'enum class' since we want scoped
69// constants but also want implicit conversions to integral types.
70namespace HandleType {
Jesse Hallc7a6eb52015-08-31 12:52:03 -070071enum Enum {
Jesse Hallc7a6eb52015-08-31 12:52:03 -070072 kBufferView,
Jesse Hall715b86a2016-01-16 16:34:29 -080073 kDebugReportCallbackEXT,
Jesse Hallc7a6eb52015-08-31 12:52:03 -070074 kDescriptorPool,
75 kDescriptorSet,
76 kDescriptorSetLayout,
Jesse Hallc7a6eb52015-08-31 12:52:03 -070077 kEvent,
78 kFence,
79 kFramebuffer,
80 kImageView,
81 kPipeline,
82 kPipelineCache,
83 kPipelineLayout,
84 kQueryPool,
85 kRenderPass,
86 kSampler,
87 kSemaphore,
Jesse Hallc7a6eb52015-08-31 12:52:03 -070088 kShaderModule,
Jesse Hallf8faf0c2015-08-31 11:34:32 -070089
Jesse Hallc7a6eb52015-08-31 12:52:03 -070090 kNumTypes
91};
92} // namespace HandleType
Jesse Hallbde8ee32015-09-01 16:24:29 -070093
Jesse Hall00f10fe2016-02-08 21:20:20 -080094const VkDeviceSize kMaxDeviceMemory = 0x10000000; // 256 MiB, arbitrary
Jesse Hallbde8ee32015-09-01 16:24:29 -070095
Jesse Hallc7a6eb52015-08-31 12:52:03 -070096} // anonymous namespace
Jesse Hallf8faf0c2015-08-31 11:34:32 -070097
Jesse Hall04f4f472015-08-16 19:51:04 -070098struct VkDevice_T {
99 hwvulkan_dispatch_t dispatch;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800100 VkAllocationCallbacks allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700101 VkInstance_T* instance;
102 VkQueue_T queue;
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700103 std::array<uint64_t, HandleType::kNumTypes> next_handle;
Jesse Hall04f4f472015-08-16 19:51:04 -0700104};
105
106// -----------------------------------------------------------------------------
107// Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device
108// later.
109
110namespace {
111int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device);
112hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice};
113} // namespace
114
115#pragma clang diagnostic push
116#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
117__attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = {
118 .common =
119 {
Michael Lentine03c64b02015-08-26 18:27:26 -0500120 .tag = HARDWARE_MODULE_TAG,
121 .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1,
122 .hal_api_version = HARDWARE_HAL_API_VERSION,
123 .id = HWVULKAN_HARDWARE_MODULE_ID,
124 .name = "Null Vulkan Driver",
125 .author = "The Android Open Source Project",
126 .methods = &nulldrv_module_methods,
Jesse Hall04f4f472015-08-16 19:51:04 -0700127 },
128};
129#pragma clang diagnostic pop
130
131// -----------------------------------------------------------------------------
132
133namespace {
134
Jesse Hall04f4f472015-08-16 19:51:04 -0700135int CloseDevice(struct hw_device_t* /*device*/) {
136 // nothing to do - opening a device doesn't allocate any resources
137 return 0;
138}
139
140hwvulkan_device_t nulldrv_device = {
141 .common =
142 {
Michael Lentine03c64b02015-08-26 18:27:26 -0500143 .tag = HARDWARE_DEVICE_TAG,
144 .version = HWVULKAN_DEVICE_API_VERSION_0_1,
145 .module = &HAL_MODULE_INFO_SYM.common,
146 .close = CloseDevice,
Jesse Hall04f4f472015-08-16 19:51:04 -0700147 },
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700148 .EnumerateInstanceExtensionProperties =
149 EnumerateInstanceExtensionProperties,
Jesse Hall04f4f472015-08-16 19:51:04 -0700150 .CreateInstance = CreateInstance,
151 .GetInstanceProcAddr = GetInstanceProcAddr};
152
153int OpenDevice(const hw_module_t* /*module*/,
154 const char* id,
155 hw_device_t** device) {
156 if (strcmp(id, HWVULKAN_DEVICE_0) == 0) {
157 *device = &nulldrv_device.common;
158 return 0;
159 }
160 return -ENOENT;
161}
162
163VkInstance_T* GetInstanceFromPhysicalDevice(
164 VkPhysicalDevice_T* physical_device) {
165 return reinterpret_cast<VkInstance_T*>(
166 reinterpret_cast<uintptr_t>(physical_device) -
167 offsetof(VkInstance_T, physical_device));
168}
169
Jesse Hall715b86a2016-01-16 16:34:29 -0800170uint64_t AllocHandle(uint64_t type, uint64_t* next_handle) {
171 const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1;
172 ALOGE_IF(*next_handle == kHandleMask,
173 "non-dispatchable handles of type=%" PRIu64
174 " are about to overflow",
175 type);
176 return (UINT64_C(1) << 63) | ((type & 0x7) << 56) |
177 ((*next_handle)++ & kHandleMask);
178}
179
180template <class Handle>
181Handle AllocHandle(VkInstance instance, HandleType::Enum type) {
182 return reinterpret_cast<Handle>(
183 AllocHandle(type, &instance->next_callback_handle));
184}
185
Michael Lentine3fec89e2015-12-04 16:25:11 -0800186template <class Handle>
187Handle AllocHandle(VkDevice device, HandleType::Enum type) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800188 return reinterpret_cast<Handle>(
Jesse Hall715b86a2016-01-16 16:34:29 -0800189 AllocHandle(type, &device->next_handle[type]));
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700190}
191
Jesse Halld3b14502016-04-20 16:58:11 -0700192VKAPI_ATTR void* DefaultAllocate(void*,
193 size_t size,
194 size_t alignment,
195 VkSystemAllocationScope) {
196 void* ptr = nullptr;
197 // Vulkan requires 'alignment' to be a power of two, but posix_memalign
198 // additionally requires that it be at least sizeof(void*).
199 int ret = posix_memalign(&ptr, std::max(alignment, sizeof(void*)), size);
200 return ret == 0 ? ptr : nullptr;
201}
202
203VKAPI_ATTR void* DefaultReallocate(void*,
204 void* ptr,
205 size_t size,
206 size_t alignment,
207 VkSystemAllocationScope) {
208 if (size == 0) {
209 free(ptr);
210 return nullptr;
211 }
212
213 // TODO(jessehall): Right now we never shrink allocations; if the new
214 // request is smaller than the existing chunk, we just continue using it.
215 // The null driver never reallocs, so this doesn't matter. If that changes,
216 // or if this code is copied into some other project, this should probably
217 // have a heuristic to allocate-copy-free when doing so will save "enough"
218 // space.
219 size_t old_size = ptr ? malloc_usable_size(ptr) : 0;
220 if (size <= old_size)
221 return ptr;
222
223 void* new_ptr = nullptr;
224 if (posix_memalign(&new_ptr, std::max(alignment, sizeof(void*)), size) != 0)
225 return nullptr;
226 if (ptr) {
227 memcpy(new_ptr, ptr, std::min(old_size, size));
228 free(ptr);
229 }
230 return new_ptr;
231}
232
233VKAPI_ATTR void DefaultFree(void*, void* ptr) {
234 free(ptr);
235}
236
237const VkAllocationCallbacks kDefaultAllocCallbacks = {
238 .pUserData = nullptr,
239 .pfnAllocation = DefaultAllocate,
240 .pfnReallocation = DefaultReallocate,
241 .pfnFree = DefaultFree,
242};
243
Jesse Hall04f4f472015-08-16 19:51:04 -0700244} // namespace
245
246namespace null_driver {
247
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800248#define DEFINE_OBJECT_HANDLE_CONVERSION(T) \
249 T* Get##T##FromHandle(Vk##T h); \
250 T* Get##T##FromHandle(Vk##T h) { \
251 return reinterpret_cast<T*>(uintptr_t(h)); \
252 } \
253 Vk##T GetHandleTo##T(const T* obj); \
254 Vk##T GetHandleTo##T(const T* obj) { \
255 return Vk##T(reinterpret_cast<uintptr_t>(obj)); \
256 }
Jesse Hallf6578742015-08-29 17:06:12 +0100257
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100258// -----------------------------------------------------------------------------
259// Global
260
Jesse Halle1b12782015-11-30 11:27:32 -0800261VKAPI_ATTR
Jesse Hall715b86a2016-01-16 16:34:29 -0800262VkResult EnumerateInstanceExtensionProperties(
263 const char* layer_name,
264 uint32_t* count,
265 VkExtensionProperties* properties) {
266 if (layer_name) {
267 ALOGW(
268 "Driver vkEnumerateInstanceExtensionProperties shouldn't be called "
269 "with a layer name ('%s')",
270 layer_name);
Jesse Hall715b86a2016-01-16 16:34:29 -0800271 }
272
273 const VkExtensionProperties kExtensions[] = {
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300274 {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION}};
Jesse Hall715b86a2016-01-16 16:34:29 -0800275 const uint32_t kExtensionsCount =
276 sizeof(kExtensions) / sizeof(kExtensions[0]);
277
278 if (!properties || *count > kExtensionsCount)
279 *count = kExtensionsCount;
280 if (properties)
281 std::copy(kExtensions, kExtensions + *count, properties);
282 return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS;
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100283}
284
Jesse Halle1b12782015-11-30 11:27:32 -0800285VKAPI_ATTR
Jesse Hall715b86a2016-01-16 16:34:29 -0800286VkResult CreateInstance(const VkInstanceCreateInfo* create_info,
Jesse Hall1f91d392015-12-11 16:28:44 -0800287 const VkAllocationCallbacks* allocator,
288 VkInstance* out_instance) {
Jesse Halld3b14502016-04-20 16:58:11 -0700289 if (!allocator)
290 allocator = &kDefaultAllocCallbacks;
Jesse Hall1f91d392015-12-11 16:28:44 -0800291
292 VkInstance_T* instance =
293 static_cast<VkInstance_T*>(allocator->pfnAllocation(
294 allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T),
295 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE));
296 if (!instance)
297 return VK_ERROR_OUT_OF_HOST_MEMORY;
298
299 instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
300 instance->allocator = *allocator;
301 instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall715b86a2016-01-16 16:34:29 -0800302 instance->next_callback_handle = 0;
Jesse Hall715b86a2016-01-16 16:34:29 -0800303
304 for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) {
305 if (strcmp(create_info->ppEnabledExtensionNames[i],
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300306 VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) {
307 ALOGV("instance extension '%s' requested",
308 create_info->ppEnabledExtensionNames[i]);
309 } else if (strcmp(create_info->ppEnabledExtensionNames[i],
Jesse Hall715b86a2016-01-16 16:34:29 -0800310 VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) {
Jesse Hallb1471272016-01-17 21:36:58 -0800311 ALOGV("instance extension '%s' requested",
312 create_info->ppEnabledExtensionNames[i]);
313 } else {
314 ALOGW("unsupported extension '%s' requested",
315 create_info->ppEnabledExtensionNames[i]);
Jesse Hall715b86a2016-01-16 16:34:29 -0800316 }
317 }
Jesse Hall1f91d392015-12-11 16:28:44 -0800318
319 *out_instance = instance;
320 return VK_SUCCESS;
321}
322
323VKAPI_ATTR
324PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
325 return instance ? GetInstanceProcAddr(name) : GetGlobalProcAddr(name);
Jesse Hall04f4f472015-08-16 19:51:04 -0700326}
327
Jesse Halle1b12782015-11-30 11:27:32 -0800328VKAPI_ATTR
Jesse Hall04f4f472015-08-16 19:51:04 -0700329PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) {
Jesse Hall1f91d392015-12-11 16:28:44 -0800330 return GetInstanceProcAddr(name);
Jesse Hall04f4f472015-08-16 19:51:04 -0700331}
332
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100333// -----------------------------------------------------------------------------
334// Instance
335
Jesse Hall03b6fe12015-11-24 12:44:21 -0800336void DestroyInstance(VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800337 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800338 instance->allocator.pfnFree(instance->allocator.pUserData, instance);
Jesse Hall04f4f472015-08-16 19:51:04 -0700339}
340
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100341// -----------------------------------------------------------------------------
342// PhysicalDevice
343
Jesse Hall04f4f472015-08-16 19:51:04 -0700344VkResult EnumeratePhysicalDevices(VkInstance instance,
345 uint32_t* physical_device_count,
346 VkPhysicalDevice* physical_devices) {
347 if (physical_devices && *physical_device_count >= 1)
348 physical_devices[0] = &instance->physical_device;
349 *physical_device_count = 1;
350 return VK_SUCCESS;
351}
352
Jesse Hall57f7f8c2016-01-17 17:21:36 -0800353VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice /*gpu*/,
354 uint32_t* count,
355 VkLayerProperties* /*properties*/) {
356 ALOGW("Driver vkEnumerateDeviceLayerProperties shouldn't be called");
357 *count = 0;
358 return VK_SUCCESS;
359}
360
361VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice /*gpu*/,
362 const char* layer_name,
363 uint32_t* count,
364 VkExtensionProperties* properties) {
365 if (layer_name) {
366 ALOGW(
367 "Driver vkEnumerateDeviceExtensionProperties shouldn't be called "
368 "with a layer name ('%s')",
369 layer_name);
370 *count = 0;
371 return VK_SUCCESS;
372 }
373
374 const VkExtensionProperties kExtensions[] = {
375 {VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME,
376 VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION}};
377 const uint32_t kExtensionsCount =
378 sizeof(kExtensions) / sizeof(kExtensions[0]);
379
380 if (!properties || *count > kExtensionsCount)
381 *count = kExtensionsCount;
382 if (properties)
383 std::copy(kExtensions, kExtensions + *count, properties);
384 return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS;
385}
386
Jesse Hall606a54e2015-11-19 22:17:28 -0800387void GetPhysicalDeviceProperties(VkPhysicalDevice,
388 VkPhysicalDeviceProperties* properties) {
Jesse Hall26763382016-05-20 07:13:52 -0700389 properties->apiVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION);
Jesse Hall04f4f472015-08-16 19:51:04 -0700390 properties->driverVersion = VK_MAKE_VERSION(0, 0, 1);
Jesse Hall65ab5522015-11-30 00:07:16 -0800391 properties->vendorID = 0;
392 properties->deviceID = 0;
Jesse Hall04f4f472015-08-16 19:51:04 -0700393 properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
394 strcpy(properties->deviceName, "Android Vulkan Null Driver");
395 memset(properties->pipelineCacheUUID, 0,
396 sizeof(properties->pipelineCacheUUID));
Jesse Hallc34849e2016-02-09 22:35:04 -0800397 properties->limits = VkPhysicalDeviceLimits{
398 4096, // maxImageDimension1D
399 4096, // maxImageDimension2D
400 256, // maxImageDimension3D
401 4096, // maxImageDimensionCube
402 256, // maxImageArrayLayers
403 65536, // maxTexelBufferElements
404 16384, // maxUniformBufferRange
405 1 << 27, // maxStorageBufferRange
406 128, // maxPushConstantsSize
407 4096, // maxMemoryAllocationCount
408 4000, // maxSamplerAllocationCount
409 1, // bufferImageGranularity
410 0, // sparseAddressSpaceSize
411 4, // maxBoundDescriptorSets
412 16, // maxPerStageDescriptorSamplers
413 12, // maxPerStageDescriptorUniformBuffers
414 4, // maxPerStageDescriptorStorageBuffers
415 16, // maxPerStageDescriptorSampledImages
416 4, // maxPerStageDescriptorStorageImages
417 4, // maxPerStageDescriptorInputAttachments
418 128, // maxPerStageResources
419 96, // maxDescriptorSetSamplers
420 72, // maxDescriptorSetUniformBuffers
421 8, // maxDescriptorSetUniformBuffersDynamic
422 24, // maxDescriptorSetStorageBuffers
423 4, // maxDescriptorSetStorageBuffersDynamic
424 96, // maxDescriptorSetSampledImages
425 24, // maxDescriptorSetStorageImages
426 4, // maxDescriptorSetInputAttachments
427 16, // maxVertexInputAttributes
428 16, // maxVertexInputBindings
429 2047, // maxVertexInputAttributeOffset
430 2048, // maxVertexInputBindingStride
431 64, // maxVertexOutputComponents
432 0, // maxTessellationGenerationLevel
433 0, // maxTessellationPatchSize
434 0, // maxTessellationControlPerVertexInputComponents
435 0, // maxTessellationControlPerVertexOutputComponents
436 0, // maxTessellationControlPerPatchOutputComponents
437 0, // maxTessellationControlTotalOutputComponents
438 0, // maxTessellationEvaluationInputComponents
439 0, // maxTessellationEvaluationOutputComponents
440 0, // maxGeometryShaderInvocations
441 0, // maxGeometryInputComponents
442 0, // maxGeometryOutputComponents
443 0, // maxGeometryOutputVertices
444 0, // maxGeometryTotalOutputComponents
445 64, // maxFragmentInputComponents
446 4, // maxFragmentOutputAttachments
447 0, // maxFragmentDualSrcAttachments
448 4, // maxFragmentCombinedOutputResources
449 16384, // maxComputeSharedMemorySize
450 {65536, 65536, 65536}, // maxComputeWorkGroupCount[3]
451 128, // maxComputeWorkGroupInvocations
452 {128, 128, 64}, // maxComputeWorkGroupSize[3]
453 4, // subPixelPrecisionBits
454 4, // subTexelPrecisionBits
455 4, // mipmapPrecisionBits
456 UINT32_MAX, // maxDrawIndexedIndexValue
457 1, // maxDrawIndirectCount
458 2, // maxSamplerLodBias
459 1, // maxSamplerAnisotropy
460 1, // maxViewports
461 {4096, 4096}, // maxViewportDimensions[2]
462 {-8192.0f, 8191.0f}, // viewportBoundsRange[2]
463 0, // viewportSubPixelBits
464 64, // minMemoryMapAlignment
465 256, // minTexelBufferOffsetAlignment
466 256, // minUniformBufferOffsetAlignment
467 256, // minStorageBufferOffsetAlignment
468 -8, // minTexelOffset
469 7, // maxTexelOffset
470 0, // minTexelGatherOffset
471 0, // maxTexelGatherOffset
472 0.0f, // minInterpolationOffset
473 0.0f, // maxInterpolationOffset
474 0, // subPixelInterpolationOffsetBits
475 4096, // maxFramebufferWidth
476 4096, // maxFramebufferHeight
477 256, // maxFramebufferLayers
478 VK_SAMPLE_COUNT_1_BIT |
479 VK_SAMPLE_COUNT_4_BIT, // framebufferColorSampleCounts
480 VK_SAMPLE_COUNT_1_BIT |
481 VK_SAMPLE_COUNT_4_BIT, // framebufferDepthSampleCounts
482 VK_SAMPLE_COUNT_1_BIT |
483 VK_SAMPLE_COUNT_4_BIT, // framebufferStencilSampleCounts
484 VK_SAMPLE_COUNT_1_BIT |
485 VK_SAMPLE_COUNT_4_BIT, // framebufferNoAttachmentsSampleCounts
486 4, // maxColorAttachments
487 VK_SAMPLE_COUNT_1_BIT |
488 VK_SAMPLE_COUNT_4_BIT, // sampledImageColorSampleCounts
489 VK_SAMPLE_COUNT_1_BIT, // sampledImageIntegerSampleCounts
490 VK_SAMPLE_COUNT_1_BIT |
491 VK_SAMPLE_COUNT_4_BIT, // sampledImageDepthSampleCounts
492 VK_SAMPLE_COUNT_1_BIT |
493 VK_SAMPLE_COUNT_4_BIT, // sampledImageStencilSampleCounts
494 VK_SAMPLE_COUNT_1_BIT, // storageImageSampleCounts
495 1, // maxSampleMaskWords
496 VK_TRUE, // timestampComputeAndGraphics
497 1, // timestampPeriod
498 0, // maxClipDistances
499 0, // maxCullDistances
500 0, // maxCombinedClipAndCullDistances
501 2, // discreteQueuePriorities
502 {1.0f, 1.0f}, // pointSizeRange[2]
503 {1.0f, 1.0f}, // lineWidthRange[2]
504 0.0f, // pointSizeGranularity
505 0.0f, // lineWidthGranularity
506 VK_TRUE, // strictLines
507 VK_TRUE, // standardSampleLocations
508 1, // optimalBufferCopyOffsetAlignment
509 1, // optimalBufferCopyRowPitchAlignment
510 64, // nonCoherentAtomSize
511 };
Jesse Hall04f4f472015-08-16 19:51:04 -0700512}
513
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300514void GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physical_device,
515 VkPhysicalDeviceProperties2KHR* properties) {
516 GetPhysicalDeviceProperties(physical_device, &properties->properties);
Chris Forbesb4eb2782017-03-15 16:09:15 +1300517
518 while (properties->pNext) {
519 properties = reinterpret_cast<VkPhysicalDeviceProperties2KHR *>(properties->pNext);
520
521#pragma clang diagnostic push
522#pragma clang diagnostic ignored "-Wold-style-cast"
523 switch ((VkFlags)properties->sType) {
524 case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID: {
525 VkPhysicalDevicePresentationPropertiesANDROID *presentation_properties =
526 reinterpret_cast<VkPhysicalDevicePresentationPropertiesANDROID *>(properties);
527#pragma clang diagnostic pop
528
529 // Claim that we do all the right things for the loader to
530 // expose KHR_shared_presentable_image on our behalf.
531 presentation_properties->sharedImage = VK_TRUE;
532 } break;
533
534 default:
535 // Silently ignore other extension query structs
536 break;
537 }
538 }
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300539}
540
Jesse Hall606a54e2015-11-19 22:17:28 -0800541void GetPhysicalDeviceQueueFamilyProperties(
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700542 VkPhysicalDevice,
543 uint32_t* count,
544 VkQueueFamilyProperties* properties) {
Jesse Hall715b86a2016-01-16 16:34:29 -0800545 if (!properties || *count > 1)
546 *count = 1;
547 if (properties && *count == 1) {
Jesse Hall65ab5522015-11-30 00:07:16 -0800548 properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT |
549 VK_QUEUE_TRANSFER_BIT;
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700550 properties->queueCount = 1;
Jesse Hallacfa5342015-11-19 21:51:33 -0800551 properties->timestampValidBits = 64;
Jesse Hall715b86a2016-01-16 16:34:29 -0800552 properties->minImageTransferGranularity = VkExtent3D{1, 1, 1};
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700553 }
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700554}
555
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300556void GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physical_device, uint32_t* count, VkQueueFamilyProperties2KHR* properties) {
557 // note: even though multiple structures, this is safe to forward in this
558 // case since we only expose one queue family.
559 GetPhysicalDeviceQueueFamilyProperties(physical_device, count, properties ? &properties->queueFamilyProperties : nullptr);
560}
561
Jesse Hall606a54e2015-11-19 22:17:28 -0800562void GetPhysicalDeviceMemoryProperties(
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100563 VkPhysicalDevice,
564 VkPhysicalDeviceMemoryProperties* properties) {
565 properties->memoryTypeCount = 1;
566 properties->memoryTypes[0].propertyFlags =
Jesse Halld1af8122015-11-29 23:50:38 -0800567 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
568 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
569 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
570 VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100571 properties->memoryTypes[0].heapIndex = 0;
572 properties->memoryHeapCount = 1;
Jesse Hallbde8ee32015-09-01 16:24:29 -0700573 properties->memoryHeaps[0].size = kMaxDeviceMemory;
Jesse Halld1af8122015-11-29 23:50:38 -0800574 properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
Jesse Hall04f4f472015-08-16 19:51:04 -0700575}
576
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300577void GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physical_device, VkPhysicalDeviceMemoryProperties2KHR* properties) {
578 GetPhysicalDeviceMemoryProperties(physical_device, &properties->memoryProperties);
579}
580
Jesse Hall8e37cf32016-01-18 04:00:57 -0800581void GetPhysicalDeviceFeatures(VkPhysicalDevice /*gpu*/,
582 VkPhysicalDeviceFeatures* features) {
583 *features = VkPhysicalDeviceFeatures{
584 VK_TRUE, // robustBufferAccess
585 VK_FALSE, // fullDrawIndexUint32
586 VK_FALSE, // imageCubeArray
587 VK_FALSE, // independentBlend
588 VK_FALSE, // geometryShader
589 VK_FALSE, // tessellationShader
590 VK_FALSE, // sampleRateShading
591 VK_FALSE, // dualSrcBlend
592 VK_FALSE, // logicOp
593 VK_FALSE, // multiDrawIndirect
594 VK_FALSE, // drawIndirectFirstInstance
595 VK_FALSE, // depthClamp
596 VK_FALSE, // depthBiasClamp
597 VK_FALSE, // fillModeNonSolid
598 VK_FALSE, // depthBounds
599 VK_FALSE, // wideLines
600 VK_FALSE, // largePoints
601 VK_FALSE, // alphaToOne
602 VK_FALSE, // multiViewport
603 VK_FALSE, // samplerAnisotropy
604 VK_FALSE, // textureCompressionETC2
605 VK_FALSE, // textureCompressionASTC_LDR
606 VK_FALSE, // textureCompressionBC
607 VK_FALSE, // occlusionQueryPrecise
608 VK_FALSE, // pipelineStatisticsQuery
609 VK_FALSE, // vertexPipelineStoresAndAtomics
610 VK_FALSE, // fragmentStoresAndAtomics
611 VK_FALSE, // shaderTessellationAndGeometryPointSize
612 VK_FALSE, // shaderImageGatherExtended
613 VK_FALSE, // shaderStorageImageExtendedFormats
614 VK_FALSE, // shaderStorageImageMultisample
615 VK_FALSE, // shaderStorageImageReadWithoutFormat
616 VK_FALSE, // shaderStorageImageWriteWithoutFormat
617 VK_FALSE, // shaderUniformBufferArrayDynamicIndexing
618 VK_FALSE, // shaderSampledImageArrayDynamicIndexing
619 VK_FALSE, // shaderStorageBufferArrayDynamicIndexing
620 VK_FALSE, // shaderStorageImageArrayDynamicIndexing
621 VK_FALSE, // shaderClipDistance
622 VK_FALSE, // shaderCullDistance
623 VK_FALSE, // shaderFloat64
624 VK_FALSE, // shaderInt64
625 VK_FALSE, // shaderInt16
626 VK_FALSE, // shaderResourceResidency
627 VK_FALSE, // shaderResourceMinLod
628 VK_FALSE, // sparseBinding
629 VK_FALSE, // sparseResidencyBuffer
630 VK_FALSE, // sparseResidencyImage2D
631 VK_FALSE, // sparseResidencyImage3D
632 VK_FALSE, // sparseResidency2Samples
633 VK_FALSE, // sparseResidency4Samples
634 VK_FALSE, // sparseResidency8Samples
635 VK_FALSE, // sparseResidency16Samples
636 VK_FALSE, // sparseResidencyAliased
637 VK_FALSE, // variableMultisampleRate
638 VK_FALSE, // inheritedQueries
639 };
640}
641
Chris Forbes86bdfbe2017-01-26 12:45:49 +1300642void GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physical_device, VkPhysicalDeviceFeatures2KHR* features) {
643 GetPhysicalDeviceFeatures(physical_device, &features->features);
644}
645
Jesse Hall73ab0ac2015-08-25 15:09:15 +0100646// -----------------------------------------------------------------------------
647// Device
648
Jesse Hall04f4f472015-08-16 19:51:04 -0700649VkResult CreateDevice(VkPhysicalDevice physical_device,
Jesse Hallb1471272016-01-17 21:36:58 -0800650 const VkDeviceCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800651 const VkAllocationCallbacks* allocator,
Jesse Hall04f4f472015-08-16 19:51:04 -0700652 VkDevice* out_device) {
653 VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800654 if (!allocator)
655 allocator = &instance->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800656 VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation(
657 allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T),
658 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE));
Jesse Hall04f4f472015-08-16 19:51:04 -0700659 if (!device)
660 return VK_ERROR_OUT_OF_HOST_MEMORY;
661
662 device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800663 device->allocator = *allocator;
Jesse Hall04f4f472015-08-16 19:51:04 -0700664 device->instance = instance;
665 device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700666 std::fill(device->next_handle.begin(), device->next_handle.end(),
667 UINT64_C(0));
Jesse Hall04f4f472015-08-16 19:51:04 -0700668
Jesse Hallb1471272016-01-17 21:36:58 -0800669 for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) {
670 if (strcmp(create_info->ppEnabledExtensionNames[i],
671 VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME) == 0) {
672 ALOGV("Enabling " VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME);
673 }
674 }
675
Jesse Hall04f4f472015-08-16 19:51:04 -0700676 *out_device = device;
677 return VK_SUCCESS;
678}
679
Jesse Hall3fbc8562015-11-29 22:10:52 -0800680void DestroyDevice(VkDevice device,
681 const VkAllocationCallbacks* /*allocator*/) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700682 if (!device)
Jesse Hallcf25c412015-10-29 17:14:50 -0700683 return;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800684 device->allocator.pfnFree(device->allocator.pUserData, device);
Jesse Hall04f4f472015-08-16 19:51:04 -0700685}
686
Jesse Hall606a54e2015-11-19 22:17:28 -0800687void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) {
Jesse Hall04f4f472015-08-16 19:51:04 -0700688 *queue = &device->queue;
Jesse Hall04f4f472015-08-16 19:51:04 -0700689}
690
691// -----------------------------------------------------------------------------
Jesse Hall3fbc8562015-11-29 22:10:52 -0800692// CommandPool
Jesse Hall03b6fe12015-11-24 12:44:21 -0800693
Jesse Hall3fbc8562015-11-29 22:10:52 -0800694struct CommandPool {
695 typedef VkCommandPool HandleType;
696 VkAllocationCallbacks allocator;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800697};
Jesse Hall3fbc8562015-11-29 22:10:52 -0800698DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800699
700VkResult CreateCommandPool(VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800701 const VkCommandPoolCreateInfo* /*create_info*/,
702 const VkAllocationCallbacks* allocator,
703 VkCommandPool* cmd_pool) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800704 if (!allocator)
705 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800706 CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation(
707 allocator->pUserData, sizeof(CommandPool), alignof(CommandPool),
708 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall03b6fe12015-11-24 12:44:21 -0800709 if (!pool)
710 return VK_ERROR_OUT_OF_HOST_MEMORY;
711 pool->allocator = *allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800712 *cmd_pool = GetHandleToCommandPool(pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800713 return VK_SUCCESS;
714}
715
716void DestroyCommandPool(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800717 VkCommandPool cmd_pool,
718 const VkAllocationCallbacks* /*allocator*/) {
719 CommandPool* pool = GetCommandPoolFromHandle(cmd_pool);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800720 pool->allocator.pfnFree(pool->allocator.pUserData, pool);
721}
722
723// -----------------------------------------------------------------------------
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700724// CmdBuffer
725
Jesse Hall3fbc8562015-11-29 22:10:52 -0800726VkResult AllocateCommandBuffers(VkDevice /*device*/,
727 const VkCommandBufferAllocateInfo* alloc_info,
728 VkCommandBuffer* cmdbufs) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800729 VkResult result = VK_SUCCESS;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800730 CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool);
Jesse Hall3dd678a2016-01-08 21:52:01 -0800731 std::fill(cmdbufs, cmdbufs + alloc_info->commandBufferCount, nullptr);
732 for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800733 cmdbufs[i] =
734 static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation(
735 pool.allocator.pUserData, sizeof(VkCommandBuffer_T),
736 alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallfbf97b02015-11-20 14:17:03 -0800737 if (!cmdbufs[i]) {
738 result = VK_ERROR_OUT_OF_HOST_MEMORY;
739 break;
740 }
741 cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
742 }
743 if (result != VK_SUCCESS) {
Jesse Hall3dd678a2016-01-08 21:52:01 -0800744 for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800745 if (!cmdbufs[i])
746 break;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800747 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800748 }
749 }
Jesse Hallfbf97b02015-11-20 14:17:03 -0800750 return result;
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700751}
752
Jesse Hall03b6fe12015-11-24 12:44:21 -0800753void FreeCommandBuffers(VkDevice /*device*/,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800754 VkCommandPool cmd_pool,
Jesse Hallfbf97b02015-11-20 14:17:03 -0800755 uint32_t count,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800756 const VkCommandBuffer* cmdbufs) {
757 CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool);
Jesse Hallfbf97b02015-11-20 14:17:03 -0800758 for (uint32_t i = 0; i < count; i++)
Jesse Hall03b6fe12015-11-24 12:44:21 -0800759 pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
Jesse Hallc7a6eb52015-08-31 12:52:03 -0700760}
761
762// -----------------------------------------------------------------------------
Jesse Hall2077ce02015-08-29 18:10:59 +0100763// DeviceMemory
764
765struct DeviceMemory {
766 typedef VkDeviceMemory HandleType;
767 VkDeviceSize size;
768 alignas(16) uint8_t data[0];
769};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800770DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory)
Jesse Hall2077ce02015-08-29 18:10:59 +0100771
Jesse Hall3fbc8562015-11-29 22:10:52 -0800772VkResult AllocateMemory(VkDevice device,
773 const VkMemoryAllocateInfo* alloc_info,
774 const VkAllocationCallbacks* allocator,
775 VkDeviceMemory* mem_handle) {
Jesse Hall2077ce02015-08-29 18:10:59 +0100776 if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize)
777 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall03b6fe12015-11-24 12:44:21 -0800778 if (!allocator)
779 allocator = &device->allocator;
Jesse Hall2077ce02015-08-29 18:10:59 +0100780
Jesse Hall2077ce02015-08-29 18:10:59 +0100781 size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize);
Jesse Hall3fbc8562015-11-29 22:10:52 -0800782 DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation(
783 allocator->pUserData, size, alignof(DeviceMemory),
784 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall2077ce02015-08-29 18:10:59 +0100785 if (!mem)
786 return VK_ERROR_OUT_OF_HOST_MEMORY;
787 mem->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800788 *mem_handle = GetHandleToDeviceMemory(mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100789 return VK_SUCCESS;
790}
791
Jesse Hall03b6fe12015-11-24 12:44:21 -0800792void FreeMemory(VkDevice device,
793 VkDeviceMemory mem_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800794 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800795 if (!allocator)
796 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800797 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800798 allocator->pfnFree(allocator->pUserData, mem);
Jesse Hall2077ce02015-08-29 18:10:59 +0100799}
800
801VkResult MapMemory(VkDevice,
802 VkDeviceMemory mem_handle,
803 VkDeviceSize offset,
804 VkDeviceSize,
805 VkMemoryMapFlags,
806 void** out_ptr) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800807 DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
Jesse Hall2077ce02015-08-29 18:10:59 +0100808 *out_ptr = &mem->data[0] + offset;
809 return VK_SUCCESS;
810}
811
812// -----------------------------------------------------------------------------
Jesse Hallf6578742015-08-29 17:06:12 +0100813// Buffer
814
815struct Buffer {
816 typedef VkBuffer HandleType;
817 VkDeviceSize size;
818};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800819DEFINE_OBJECT_HANDLE_CONVERSION(Buffer)
Jesse Hallf6578742015-08-29 17:06:12 +0100820
821VkResult CreateBuffer(VkDevice device,
822 const VkBufferCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800823 const VkAllocationCallbacks* allocator,
Jesse Hallf6578742015-08-29 17:06:12 +0100824 VkBuffer* buffer_handle) {
Jesse Hallbde8ee32015-09-01 16:24:29 -0700825 ALOGW_IF(create_info->size > kMaxDeviceMemory,
826 "CreateBuffer: requested size 0x%" PRIx64
827 " exceeds max device memory size 0x%" PRIx64,
828 create_info->size, kMaxDeviceMemory);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800829 if (!allocator)
830 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800831 Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation(
832 allocator->pUserData, sizeof(Buffer), alignof(Buffer),
833 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hallf6578742015-08-29 17:06:12 +0100834 if (!buffer)
835 return VK_ERROR_OUT_OF_HOST_MEMORY;
836 buffer->size = create_info->size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800837 *buffer_handle = GetHandleToBuffer(buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100838 return VK_SUCCESS;
839}
840
Jesse Hall606a54e2015-11-19 22:17:28 -0800841void GetBufferMemoryRequirements(VkDevice,
842 VkBuffer buffer_handle,
843 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800844 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hallf6578742015-08-29 17:06:12 +0100845 requirements->size = buffer->size;
846 requirements->alignment = 16; // allow fast Neon/SSE memcpy
847 requirements->memoryTypeBits = 0x1;
Jesse Hallf6578742015-08-29 17:06:12 +0100848}
849
Jesse Hall03b6fe12015-11-24 12:44:21 -0800850void DestroyBuffer(VkDevice device,
851 VkBuffer buffer_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800852 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800853 if (!allocator)
854 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800855 Buffer* buffer = GetBufferFromHandle(buffer_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800856 allocator->pfnFree(allocator->pUserData, buffer);
Jesse Hallf6578742015-08-29 17:06:12 +0100857}
858
859// -----------------------------------------------------------------------------
Jesse Hall85c05b62015-09-01 18:07:41 -0700860// Image
861
862struct Image {
863 typedef VkImage HandleType;
864 VkDeviceSize size;
865};
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800866DEFINE_OBJECT_HANDLE_CONVERSION(Image)
Jesse Hall85c05b62015-09-01 18:07:41 -0700867
868VkResult CreateImage(VkDevice device,
869 const VkImageCreateInfo* create_info,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800870 const VkAllocationCallbacks* allocator,
Jesse Hall85c05b62015-09-01 18:07:41 -0700871 VkImage* image_handle) {
872 if (create_info->imageType != VK_IMAGE_TYPE_2D ||
873 create_info->format != VK_FORMAT_R8G8B8A8_UNORM ||
874 create_info->mipLevels != 1) {
875 ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u",
876 create_info->imageType, create_info->format,
877 create_info->mipLevels);
Jesse Halla15a4bf2015-11-19 22:48:02 -0800878 return VK_ERROR_OUT_OF_HOST_MEMORY;
Jesse Hall85c05b62015-09-01 18:07:41 -0700879 }
880
881 VkDeviceSize size =
882 VkDeviceSize(create_info->extent.width * create_info->extent.height) *
Jesse Halla15a4bf2015-11-19 22:48:02 -0800883 create_info->arrayLayers * create_info->samples * 4u;
Jesse Hall85c05b62015-09-01 18:07:41 -0700884 ALOGW_IF(size > kMaxDeviceMemory,
885 "CreateImage: image size 0x%" PRIx64
886 " exceeds max device memory size 0x%" PRIx64,
887 size, kMaxDeviceMemory);
888
Jesse Hall03b6fe12015-11-24 12:44:21 -0800889 if (!allocator)
890 allocator = &device->allocator;
Jesse Hall3fbc8562015-11-29 22:10:52 -0800891 Image* image = static_cast<Image*>(allocator->pfnAllocation(
892 allocator->pUserData, sizeof(Image), alignof(Image),
893 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
Jesse Hall85c05b62015-09-01 18:07:41 -0700894 if (!image)
895 return VK_ERROR_OUT_OF_HOST_MEMORY;
896 image->size = size;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800897 *image_handle = GetHandleToImage(image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700898 return VK_SUCCESS;
899}
900
Jesse Hall606a54e2015-11-19 22:17:28 -0800901void GetImageMemoryRequirements(VkDevice,
902 VkImage image_handle,
903 VkMemoryRequirements* requirements) {
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800904 Image* image = GetImageFromHandle(image_handle);
Jesse Hall85c05b62015-09-01 18:07:41 -0700905 requirements->size = image->size;
906 requirements->alignment = 16; // allow fast Neon/SSE memcpy
907 requirements->memoryTypeBits = 0x1;
Jesse Hall85c05b62015-09-01 18:07:41 -0700908}
909
Jesse Hall03b6fe12015-11-24 12:44:21 -0800910void DestroyImage(VkDevice device,
911 VkImage image_handle,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800912 const VkAllocationCallbacks* allocator) {
Jesse Hall03b6fe12015-11-24 12:44:21 -0800913 if (!allocator)
914 allocator = &device->allocator;
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800915 Image* image = GetImageFromHandle(image_handle);
Jesse Hall03b6fe12015-11-24 12:44:21 -0800916 allocator->pfnFree(allocator->pUserData, image);
Jesse Hall85c05b62015-09-01 18:07:41 -0700917}
918
Jesse Hall57f7f8c2016-01-17 17:21:36 -0800919VkResult GetSwapchainGrallocUsageANDROID(VkDevice,
920 VkFormat,
921 VkImageUsageFlags,
922 int* grallocUsage) {
923 // The null driver never reads or writes the gralloc buffer
924 *grallocUsage = 0;
925 return VK_SUCCESS;
926}
927
Chris Forbes8e4438b2016-12-07 16:26:49 +1300928VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice,
929 VkFormat,
930 VkImageUsageFlags,
931 VkSwapchainImageUsageFlagsANDROID,
Jesse Halld1abd742017-02-09 21:45:51 -0800932 uint64_t* grallocConsumerUsage,
933 uint64_t* grallocProducerUsage) {
Chris Forbes8e4438b2016-12-07 16:26:49 +1300934 // The null driver never reads or writes the gralloc buffer
Jesse Halld1abd742017-02-09 21:45:51 -0800935 *grallocConsumerUsage = 0;
936 *grallocProducerUsage = 0;
Chris Forbes8e4438b2016-12-07 16:26:49 +1300937 return VK_SUCCESS;
938}
939
Jesse Hall57f7f8c2016-01-17 17:21:36 -0800940VkResult AcquireImageANDROID(VkDevice,
941 VkImage,
942 int fence,
943 VkSemaphore,
944 VkFence) {
945 close(fence);
946 return VK_SUCCESS;
947}
948
949VkResult QueueSignalReleaseImageANDROID(VkQueue,
950 uint32_t,
951 const VkSemaphore*,
952 VkImage,
953 int* fence) {
954 *fence = -1;
955 return VK_SUCCESS;
956}
957
Jesse Hall85c05b62015-09-01 18:07:41 -0700958// -----------------------------------------------------------------------------
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700959// No-op types
960
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700961VkResult CreateBufferView(VkDevice device,
962 const VkBufferViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800963 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700964 VkBufferView* view) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800965 *view = AllocHandle<VkBufferView>(device, HandleType::kBufferView);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700966 return VK_SUCCESS;
967}
968
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700969VkResult CreateDescriptorPool(VkDevice device,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700970 const VkDescriptorPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800971 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700972 VkDescriptorPool* pool) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800973 *pool = AllocHandle<VkDescriptorPool>(device, HandleType::kDescriptorPool);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700974 return VK_SUCCESS;
975}
976
Jesse Hall3fbc8562015-11-29 22:10:52 -0800977VkResult AllocateDescriptorSets(VkDevice device,
978 const VkDescriptorSetAllocateInfo* alloc_info,
979 VkDescriptorSet* descriptor_sets) {
Jesse Hall3dd678a2016-01-08 21:52:01 -0800980 for (uint32_t i = 0; i < alloc_info->descriptorSetCount; i++)
Michael Lentine3fec89e2015-12-04 16:25:11 -0800981 descriptor_sets[i] =
982 AllocHandle<VkDescriptorSet>(device, HandleType::kDescriptorSet);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700983 return VK_SUCCESS;
984}
985
986VkResult CreateDescriptorSetLayout(VkDevice device,
987 const VkDescriptorSetLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800988 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700989 VkDescriptorSetLayout* layout) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800990 *layout = AllocHandle<VkDescriptorSetLayout>(
991 device, HandleType::kDescriptorSetLayout);
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700992 return VK_SUCCESS;
993}
994
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700995VkResult CreateEvent(VkDevice device,
996 const VkEventCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800997 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -0700998 VkEvent* event) {
Michael Lentine3fec89e2015-12-04 16:25:11 -0800999 *event = AllocHandle<VkEvent>(device, HandleType::kEvent);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001000 return VK_SUCCESS;
1001}
1002
1003VkResult CreateFence(VkDevice device,
1004 const VkFenceCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001005 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001006 VkFence* fence) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001007 *fence = AllocHandle<VkFence>(device, HandleType::kFence);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001008 return VK_SUCCESS;
1009}
1010
1011VkResult CreateFramebuffer(VkDevice device,
1012 const VkFramebufferCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001013 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001014 VkFramebuffer* framebuffer) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001015 *framebuffer = AllocHandle<VkFramebuffer>(device, HandleType::kFramebuffer);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001016 return VK_SUCCESS;
1017}
1018
1019VkResult CreateImageView(VkDevice device,
1020 const VkImageViewCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001021 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001022 VkImageView* view) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001023 *view = AllocHandle<VkImageView>(device, HandleType::kImageView);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001024 return VK_SUCCESS;
1025}
1026
1027VkResult CreateGraphicsPipelines(VkDevice device,
1028 VkPipelineCache,
1029 uint32_t count,
1030 const VkGraphicsPipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001031 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001032 VkPipeline* pipelines) {
1033 for (uint32_t i = 0; i < count; i++)
Michael Lentine3fec89e2015-12-04 16:25:11 -08001034 pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001035 return VK_SUCCESS;
1036}
1037
1038VkResult CreateComputePipelines(VkDevice device,
1039 VkPipelineCache,
1040 uint32_t count,
1041 const VkComputePipelineCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001042 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001043 VkPipeline* pipelines) {
1044 for (uint32_t i = 0; i < count; i++)
Michael Lentine3fec89e2015-12-04 16:25:11 -08001045 pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001046 return VK_SUCCESS;
1047}
1048
1049VkResult CreatePipelineCache(VkDevice device,
1050 const VkPipelineCacheCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001051 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001052 VkPipelineCache* cache) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001053 *cache = AllocHandle<VkPipelineCache>(device, HandleType::kPipelineCache);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001054 return VK_SUCCESS;
1055}
1056
1057VkResult CreatePipelineLayout(VkDevice device,
1058 const VkPipelineLayoutCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001059 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001060 VkPipelineLayout* layout) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001061 *layout =
1062 AllocHandle<VkPipelineLayout>(device, HandleType::kPipelineLayout);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001063 return VK_SUCCESS;
1064}
1065
1066VkResult CreateQueryPool(VkDevice device,
1067 const VkQueryPoolCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001068 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001069 VkQueryPool* pool) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001070 *pool = AllocHandle<VkQueryPool>(device, HandleType::kQueryPool);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001071 return VK_SUCCESS;
1072}
1073
1074VkResult CreateRenderPass(VkDevice device,
1075 const VkRenderPassCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001076 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001077 VkRenderPass* renderpass) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001078 *renderpass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001079 return VK_SUCCESS;
1080}
1081
1082VkResult CreateSampler(VkDevice device,
1083 const VkSamplerCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001084 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001085 VkSampler* sampler) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001086 *sampler = AllocHandle<VkSampler>(device, HandleType::kSampler);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001087 return VK_SUCCESS;
1088}
1089
1090VkResult CreateSemaphore(VkDevice device,
1091 const VkSemaphoreCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001092 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001093 VkSemaphore* semaphore) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001094 *semaphore = AllocHandle<VkSemaphore>(device, HandleType::kSemaphore);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001095 return VK_SUCCESS;
1096}
1097
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001098VkResult CreateShaderModule(VkDevice device,
1099 const VkShaderModuleCreateInfo*,
Jesse Hall3fbc8562015-11-29 22:10:52 -08001100 const VkAllocationCallbacks* /*allocator*/,
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001101 VkShaderModule* module) {
Michael Lentine3fec89e2015-12-04 16:25:11 -08001102 *module = AllocHandle<VkShaderModule>(device, HandleType::kShaderModule);
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001103 return VK_SUCCESS;
1104}
1105
Jesse Hall715b86a2016-01-16 16:34:29 -08001106VkResult CreateDebugReportCallbackEXT(VkInstance instance,
1107 const VkDebugReportCallbackCreateInfoEXT*,
1108 const VkAllocationCallbacks*,
1109 VkDebugReportCallbackEXT* callback) {
1110 *callback = AllocHandle<VkDebugReportCallbackEXT>(
1111 instance, HandleType::kDebugReportCallbackEXT);
1112 return VK_SUCCESS;
1113}
1114
Jesse Hallf8faf0c2015-08-31 11:34:32 -07001115// -----------------------------------------------------------------------------
Jesse Hall04f4f472015-08-16 19:51:04 -07001116// No-op entrypoints
1117
1118// clang-format off
1119#pragma clang diagnostic push
1120#pragma clang diagnostic ignored "-Wunused-parameter"
1121
Jesse Hall606a54e2015-11-19 22:17:28 -08001122void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001123 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001124}
1125
Chris Forbes86bdfbe2017-01-26 12:45:49 +13001126void GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR* pFormatProperties) {
1127 ALOGV("TODO: vk%s", __FUNCTION__);
1128}
1129
Jesse Halla9e57032015-11-30 01:03:10 -08001130VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001131 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Halla9e57032015-11-30 01:03:10 -08001132 return VK_SUCCESS;
Jesse Hall04f4f472015-08-16 19:51:04 -07001133}
1134
Chris Forbes86bdfbe2017-01-26 12:45:49 +13001135VkResult GetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,
1136 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
1137 VkImageFormatProperties2KHR* pImageFormatProperties) {
1138 ALOGV("TODO: vk%s", __FUNCTION__);
1139 return VK_SUCCESS;
1140}
1141
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001142VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001143 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001144 return VK_SUCCESS;
1145}
1146
Jesse Halla366a512015-11-19 22:30:07 -08001147VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001148 return VK_SUCCESS;
1149}
1150
1151VkResult QueueWaitIdle(VkQueue queue) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001152 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001153 return VK_SUCCESS;
1154}
1155
1156VkResult DeviceWaitIdle(VkDevice device) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001157 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001158 return VK_SUCCESS;
1159}
1160
Jesse Hallcf25c412015-10-29 17:14:50 -07001161void UnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001162}
1163
1164VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001165 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001166 return VK_SUCCESS;
1167}
1168
1169VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001170 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001171 return VK_SUCCESS;
1172}
1173
Jesse Hall606a54e2015-11-19 22:17:28 -08001174void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001175 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001176}
1177
Jesse Hall04f4f472015-08-16 19:51:04 -07001178VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) {
1179 return VK_SUCCESS;
1180}
1181
Jesse Hall04f4f472015-08-16 19:51:04 -07001182VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) {
1183 return VK_SUCCESS;
1184}
1185
Jesse Hall606a54e2015-11-19 22:17:28 -08001186void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001187 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001188}
1189
Jesse Hall091ed9e2015-11-30 00:55:29 -08001190void 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 +01001191 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001192}
1193
Chris Forbes86bdfbe2017-01-26 12:45:49 +13001194void GetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,
1195 VkPhysicalDeviceSparseImageFormatInfo2KHR const* pInfo,
1196 unsigned int* pNumProperties,
1197 VkSparseImageFormatProperties2KHR* pProperties) {
1198 ALOGV("TODO: vk%s", __FUNCTION__);
1199}
1200
1201
Jesse Halla6429252015-11-29 18:59:42 -08001202VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001203 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001204 return VK_SUCCESS;
1205}
1206
Jesse Hall3fbc8562015-11-29 22:10:52 -08001207void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001208}
1209
1210VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
1211 return VK_SUCCESS;
1212}
1213
1214VkResult GetFenceStatus(VkDevice device, VkFence fence) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001215 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001216 return VK_SUCCESS;
1217}
1218
1219VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {
1220 return VK_SUCCESS;
1221}
1222
Jesse Hall3fbc8562015-11-29 22:10:52 -08001223void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001224}
1225
Jesse Hall3fbc8562015-11-29 22:10:52 -08001226void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001227}
1228
1229VkResult GetEventStatus(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001230 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001231 return VK_SUCCESS;
1232}
1233
1234VkResult SetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001235 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001236 return VK_SUCCESS;
1237}
1238
1239VkResult ResetEvent(VkDevice device, VkEvent event) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001240 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001241 return VK_SUCCESS;
1242}
1243
Jesse Hall3fbc8562015-11-29 22:10:52 -08001244void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001245}
1246
Jesse Halla9bb62b2015-11-21 19:31:56 -08001247VkResult 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 +01001248 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001249 return VK_SUCCESS;
1250}
1251
Jesse Hall3fbc8562015-11-29 22:10:52 -08001252void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001253}
1254
Jesse Hall606a54e2015-11-19 22:17:28 -08001255void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001256 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001257}
1258
Jesse Hall3fbc8562015-11-29 22:10:52 -08001259void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001260}
1261
Jesse Hall3fbc8562015-11-29 22:10:52 -08001262void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001263}
1264
Jesse Hall3fbc8562015-11-29 22:10:52 -08001265void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001266}
1267
Jesse Halla9bb62b2015-11-21 19:31:56 -08001268VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001269 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001270 return VK_SUCCESS;
1271}
1272
1273VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001274 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001275 return VK_SUCCESS;
1276}
1277
Jesse Hall3fbc8562015-11-29 22:10:52 -08001278void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001279}
1280
Jesse Hall3fbc8562015-11-29 22:10:52 -08001281void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001282}
1283
Jesse Hall3fbc8562015-11-29 22:10:52 -08001284void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001285}
1286
Jesse Hall3fbc8562015-11-29 22:10:52 -08001287void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001288}
1289
Jesse Hall3fbc8562015-11-29 22:10:52 -08001290void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001291}
1292
Jesse Hallfbf97b02015-11-20 14:17:03 -08001293VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001294 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001295 return VK_SUCCESS;
1296}
1297
Jesse Hallcf25c412015-10-29 17:14:50 -07001298void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001299 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001300}
1301
1302VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001303 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001304 return VK_SUCCESS;
1305}
1306
Jesse Hall3fbc8562015-11-29 22:10:52 -08001307void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001308}
1309
Jesse Hall3fbc8562015-11-29 22:10:52 -08001310void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001311}
1312
Jesse Hall606a54e2015-11-19 22:17:28 -08001313void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001314 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001315}
1316
Jesse Hall3fbc8562015-11-29 22:10:52 -08001317VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001318 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001319 return VK_SUCCESS;
1320}
1321
Jesse Hall3fbc8562015-11-29 22:10:52 -08001322VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001323 return VK_SUCCESS;
1324}
1325
Jesse Hall3fbc8562015-11-29 22:10:52 -08001326VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001327 return VK_SUCCESS;
1328}
1329
Jesse Hall3fbc8562015-11-29 22:10:52 -08001330VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) {
Jesse Hall73ab0ac2015-08-25 15:09:15 +01001331 ALOGV("TODO: vk%s", __FUNCTION__);
Jesse Hall04f4f472015-08-16 19:51:04 -07001332 return VK_SUCCESS;
1333}
1334
Jesse Hall3fbc8562015-11-29 22:10:52 -08001335void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001336}
1337
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001338void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001339}
1340
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001341void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001342}
1343
Jesse Hall3fbc8562015-11-29 22:10:52 -08001344void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001345}
1346
Jesse Hall3fbc8562015-11-29 22:10:52 -08001347void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001348}
1349
Jesse Hall3fbc8562015-11-29 22:10:52 -08001350void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001351}
1352
Jesse Hall3fbc8562015-11-29 22:10:52 -08001353void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001354}
1355
Jesse Hall3fbc8562015-11-29 22:10:52 -08001356void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001357}
1358
Jesse Hall3fbc8562015-11-29 22:10:52 -08001359void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001360}
1361
Jesse Hall3fbc8562015-11-29 22:10:52 -08001362void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001363}
1364
Jesse Hall3fbc8562015-11-29 22:10:52 -08001365void 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 -07001366}
1367
Jesse Hall3fbc8562015-11-29 22:10:52 -08001368void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001369}
1370
Jesse Hall3fbc8562015-11-29 22:10:52 -08001371void CmdBindVertexBuffers(VkCommandBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001372}
1373
Jesse Hall3fbc8562015-11-29 22:10:52 -08001374void CmdDraw(VkCommandBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001375}
1376
Jesse Hall3fbc8562015-11-29 22:10:52 -08001377void 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 -07001378}
1379
Jesse Hall3fbc8562015-11-29 22:10:52 -08001380void CmdDrawIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001381}
1382
Jesse Hall3fbc8562015-11-29 22:10:52 -08001383void CmdDrawIndexedIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001384}
1385
Jesse Hall3fbc8562015-11-29 22:10:52 -08001386void CmdDispatch(VkCommandBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001387}
1388
Jesse Hall3fbc8562015-11-29 22:10:52 -08001389void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001390}
1391
Jesse Hall3fbc8562015-11-29 22:10:52 -08001392void CmdCopyBuffer(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001393}
1394
Jesse Hall3fbc8562015-11-29 22:10:52 -08001395void CmdCopyImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001396}
1397
Jesse Hall3fbc8562015-11-29 22:10:52 -08001398void 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 -07001399}
1400
Jesse Hall3fbc8562015-11-29 22:10:52 -08001401void CmdCopyBufferToImage(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001402}
1403
Jesse Hall3fbc8562015-11-29 22:10:52 -08001404void CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001405}
1406
Jesse Hall56d386a2016-07-26 15:20:40 -07001407void CmdUpdateBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const void* pData) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001408}
1409
Jesse Hall3fbc8562015-11-29 22:10:52 -08001410void CmdFillBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001411}
1412
Jesse Hall3fbc8562015-11-29 22:10:52 -08001413void CmdClearColorImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001414}
1415
Jesse Hall3fbc8562015-11-29 22:10:52 -08001416void CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001417}
1418
Jesse Hall3fbc8562015-11-29 22:10:52 -08001419void CmdClearAttachments(VkCommandBuffer cmdBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001420}
1421
Jesse Hall3fbc8562015-11-29 22:10:52 -08001422void CmdResolveImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001423}
1424
Jesse Hall3fbc8562015-11-29 22:10:52 -08001425void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001426}
1427
Jesse Hall3fbc8562015-11-29 22:10:52 -08001428void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001429}
1430
Jesse Hall3dd678a2016-01-08 21:52:01 -08001431void CmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001432}
1433
Jesse Hall3dd678a2016-01-08 21:52:01 -08001434void CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001435}
1436
Jesse Hall3fbc8562015-11-29 22:10:52 -08001437void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001438}
1439
Jesse Hall3fbc8562015-11-29 22:10:52 -08001440void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001441}
1442
Jesse Hall3fbc8562015-11-29 22:10:52 -08001443void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001444}
1445
Jesse Hall3fbc8562015-11-29 22:10:52 -08001446void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001447}
1448
Jesse Hall3fbc8562015-11-29 22:10:52 -08001449void 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 -07001450}
1451
Jesse Hall3fbc8562015-11-29 22:10:52 -08001452void CmdPushConstants(VkCommandBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001453}
1454
Jesse Hall65ab5522015-11-30 00:07:16 -08001455void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001456}
1457
Jesse Hall65ab5522015-11-30 00:07:16 -08001458void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001459}
1460
Jesse Hall3fbc8562015-11-29 22:10:52 -08001461void CmdEndRenderPass(VkCommandBuffer cmdBuffer) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001462}
1463
Jesse Hall3fbc8562015-11-29 22:10:52 -08001464void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) {
Jesse Hall04f4f472015-08-16 19:51:04 -07001465}
1466
Jesse Hall715b86a2016-01-16 16:34:29 -08001467void DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) {
1468}
1469
1470void DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) {
1471}
1472
Jesse Hall04f4f472015-08-16 19:51:04 -07001473#pragma clang diagnostic pop
1474// clang-format on
1475
1476} // namespace null_driver