• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2015 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <android/hardware_buffer.h>
18 #include <hardware/hwvulkan.h>
19 
20 #include <errno.h>
21 #include <inttypes.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <unistd.h>
25 
26 #include <algorithm>
27 #include <array>
28 
29 #include <log/log.h>
30 
31 #include "null_driver_gen.h"
32 
33 using namespace null_driver;
34 
35 struct VkPhysicalDevice_T {
36     hwvulkan_dispatch_t dispatch;
37 };
38 
39 struct VkInstance_T {
40     hwvulkan_dispatch_t dispatch;
41     VkAllocationCallbacks allocator;
42     VkPhysicalDevice_T physical_device;
43     uint64_t next_callback_handle;
44 };
45 
46 struct VkQueue_T {
47     hwvulkan_dispatch_t dispatch;
48 };
49 
50 struct VkCommandBuffer_T {
51     hwvulkan_dispatch_t dispatch;
52 };
53 
54 namespace {
55 // Handles for non-dispatchable objects are either pointers, or arbitrary
56 // 64-bit non-zero values. We only use pointers when we need to keep state for
57 // the object even in a null driver. For the rest, we form a handle as:
58 //   [63:63] = 1 to distinguish from pointer handles*
59 //   [62:56] = non-zero handle type enum value
60 //   [55: 0] = per-handle-type incrementing counter
61 // * This works because virtual addresses with the high bit set are reserved
62 // for kernel data in all ABIs we run on.
63 //
64 // We never reclaim handles on vkDestroy*. It's not even necessary for us to
65 // have distinct handles for live objects, and practically speaking we won't
66 // ever create 2^56 objects of the same type from a single VkDevice in a null
67 // driver.
68 //
69 // Using a namespace here instead of 'enum class' since we want scoped
70 // constants but also want implicit conversions to integral types.
71 namespace HandleType {
72 enum Enum {
73     kBufferView,
74     kDebugReportCallbackEXT,
75     kDescriptorPool,
76     kDescriptorSet,
77     kDescriptorSetLayout,
78     kEvent,
79     kFence,
80     kFramebuffer,
81     kImageView,
82     kPipeline,
83     kPipelineCache,
84     kPipelineLayout,
85     kQueryPool,
86     kRenderPass,
87     kSampler,
88     kSemaphore,
89     kShaderModule,
90 
91     kNumTypes
92 };
93 }  // namespace HandleType
94 
95 const VkDeviceSize kMaxDeviceMemory = 0x10000000;  // 256 MiB, arbitrary
96 
97 }  // anonymous namespace
98 
99 struct VkDevice_T {
100     hwvulkan_dispatch_t dispatch;
101     VkAllocationCallbacks allocator;
102     VkInstance_T* instance;
103     VkQueue_T queue;
104     std::array<uint64_t, HandleType::kNumTypes> next_handle;
105 };
106 
107 // -----------------------------------------------------------------------------
108 // Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device
109 // later.
110 
111 namespace {
112 int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device);
113 hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice};
114 }  // namespace
115 
116 #pragma clang diagnostic push
117 #pragma clang diagnostic ignored "-Wmissing-variable-declarations"
118 __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = {
119     .common =
120         {
121             .tag = HARDWARE_MODULE_TAG,
122             .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1,
123             .hal_api_version = HARDWARE_HAL_API_VERSION,
124             .id = HWVULKAN_HARDWARE_MODULE_ID,
125             .name = "Null Vulkan Driver",
126             .author = "The Android Open Source Project",
127             .methods = &nulldrv_module_methods,
128         },
129 };
130 #pragma clang diagnostic pop
131 
132 // -----------------------------------------------------------------------------
133 
134 namespace {
135 
CloseDevice(struct hw_device_t *)136 int CloseDevice(struct hw_device_t* /*device*/) {
137     // nothing to do - opening a device doesn't allocate any resources
138     return 0;
139 }
140 
141 hwvulkan_device_t nulldrv_device = {
142     .common =
143         {
144             .tag = HARDWARE_DEVICE_TAG,
145             .version = HWVULKAN_DEVICE_API_VERSION_0_1,
146             .module = &HAL_MODULE_INFO_SYM.common,
147             .close = CloseDevice,
148         },
149     .EnumerateInstanceExtensionProperties =
150         EnumerateInstanceExtensionProperties,
151     .CreateInstance = CreateInstance,
152     .GetInstanceProcAddr = GetInstanceProcAddr};
153 
OpenDevice(const hw_module_t *,const char * id,hw_device_t ** device)154 int OpenDevice(const hw_module_t* /*module*/,
155                const char* id,
156                hw_device_t** device) {
157     if (strcmp(id, HWVULKAN_DEVICE_0) == 0) {
158         *device = &nulldrv_device.common;
159         return 0;
160     }
161     return -ENOENT;
162 }
163 
GetInstanceFromPhysicalDevice(VkPhysicalDevice_T * physical_device)164 VkInstance_T* GetInstanceFromPhysicalDevice(
165     VkPhysicalDevice_T* physical_device) {
166     return reinterpret_cast<VkInstance_T*>(
167         reinterpret_cast<uintptr_t>(physical_device) -
168         offsetof(VkInstance_T, physical_device));
169 }
170 
AllocHandle(uint64_t type,uint64_t * next_handle)171 uint64_t AllocHandle(uint64_t type, uint64_t* next_handle) {
172     const uint64_t kHandleMask = (UINT64_C(1) << 56) - 1;
173     ALOGE_IF(*next_handle == kHandleMask,
174              "non-dispatchable handles of type=%" PRIu64
175              " are about to overflow",
176              type);
177     return (UINT64_C(1) << 63) | ((type & 0x7) << 56) |
178            ((*next_handle)++ & kHandleMask);
179 }
180 
181 template <class Handle>
AllocHandle(VkInstance instance,HandleType::Enum type)182 Handle AllocHandle(VkInstance instance, HandleType::Enum type) {
183     return reinterpret_cast<Handle>(
184         AllocHandle(type, &instance->next_callback_handle));
185 }
186 
187 template <class Handle>
AllocHandle(VkDevice device,HandleType::Enum type)188 Handle AllocHandle(VkDevice device, HandleType::Enum type) {
189     return reinterpret_cast<Handle>(
190         AllocHandle(type, &device->next_handle[type]));
191 }
192 
DefaultAllocate(void *,size_t size,size_t alignment,VkSystemAllocationScope)193 VKAPI_ATTR void* DefaultAllocate(void*,
194                                  size_t size,
195                                  size_t alignment,
196                                  VkSystemAllocationScope) {
197     void* ptr = nullptr;
198     // Vulkan requires 'alignment' to be a power of two, but posix_memalign
199     // additionally requires that it be at least sizeof(void*).
200     int ret = posix_memalign(&ptr, std::max(alignment, sizeof(void*)), size);
201     return ret == 0 ? ptr : nullptr;
202 }
203 
DefaultReallocate(void *,void * ptr,size_t size,size_t alignment,VkSystemAllocationScope)204 VKAPI_ATTR void* DefaultReallocate(void*,
205                                    void* ptr,
206                                    size_t size,
207                                    size_t alignment,
208                                    VkSystemAllocationScope) {
209     if (size == 0) {
210         free(ptr);
211         return nullptr;
212     }
213 
214     // TODO(jessehall): Right now we never shrink allocations; if the new
215     // request is smaller than the existing chunk, we just continue using it.
216     // The null driver never reallocs, so this doesn't matter. If that changes,
217     // or if this code is copied into some other project, this should probably
218     // have a heuristic to allocate-copy-free when doing so will save "enough"
219     // space.
220     size_t old_size = ptr ? malloc_usable_size(ptr) : 0;
221     if (size <= old_size)
222         return ptr;
223 
224     void* new_ptr = nullptr;
225     if (posix_memalign(&new_ptr, std::max(alignment, sizeof(void*)), size) != 0)
226         return nullptr;
227     if (ptr) {
228         memcpy(new_ptr, ptr, std::min(old_size, size));
229         free(ptr);
230     }
231     return new_ptr;
232 }
233 
DefaultFree(void *,void * ptr)234 VKAPI_ATTR void DefaultFree(void*, void* ptr) {
235     free(ptr);
236 }
237 
238 const VkAllocationCallbacks kDefaultAllocCallbacks = {
239     .pUserData = nullptr,
240     .pfnAllocation = DefaultAllocate,
241     .pfnReallocation = DefaultReallocate,
242     .pfnFree = DefaultFree,
243 };
244 
245 }  // namespace
246 
247 namespace null_driver {
248 
249 #define DEFINE_OBJECT_HANDLE_CONVERSION(T)              \
250     T* Get##T##FromHandle(Vk##T h);                     \
251     T* Get##T##FromHandle(Vk##T h) {                    \
252         return reinterpret_cast<T*>(uintptr_t(h));      \
253     }                                                   \
254     Vk##T GetHandleTo##T(const T* obj);                 \
255     Vk##T GetHandleTo##T(const T* obj) {                \
256         return Vk##T(reinterpret_cast<uintptr_t>(obj)); \
257     }
258 
259 // -----------------------------------------------------------------------------
260 // Global
261 
262 VKAPI_ATTR
EnumerateInstanceVersion(uint32_t * pApiVersion)263 VkResult EnumerateInstanceVersion(uint32_t* pApiVersion) {
264     *pApiVersion = VK_API_VERSION_1_3;
265     return VK_SUCCESS;
266 }
267 
268 VKAPI_ATTR
EnumerateInstanceExtensionProperties(const char * layer_name,uint32_t * count,VkExtensionProperties * properties)269 VkResult EnumerateInstanceExtensionProperties(
270     const char* layer_name,
271     uint32_t* count,
272     VkExtensionProperties* properties) {
273     if (layer_name) {
274         ALOGW(
275             "Driver vkEnumerateInstanceExtensionProperties shouldn't be called "
276             "with a layer name ('%s')",
277             layer_name);
278     }
279 
280     const VkExtensionProperties kExtensions[] = {
281         {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION}};
282     const uint32_t kExtensionsCount =
283         sizeof(kExtensions) / sizeof(kExtensions[0]);
284 
285     if (!properties || *count > kExtensionsCount)
286         *count = kExtensionsCount;
287     if (properties)
288         std::copy(kExtensions, kExtensions + *count, properties);
289     return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS;
290 }
291 
292 VKAPI_ATTR
CreateInstance(const VkInstanceCreateInfo * create_info,const VkAllocationCallbacks * allocator,VkInstance * out_instance)293 VkResult CreateInstance(const VkInstanceCreateInfo* create_info,
294                         const VkAllocationCallbacks* allocator,
295                         VkInstance* out_instance) {
296     if (!allocator)
297         allocator = &kDefaultAllocCallbacks;
298 
299     VkInstance_T* instance =
300         static_cast<VkInstance_T*>(allocator->pfnAllocation(
301             allocator->pUserData, sizeof(VkInstance_T), alignof(VkInstance_T),
302             VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE));
303     if (!instance)
304         return VK_ERROR_OUT_OF_HOST_MEMORY;
305 
306     instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
307     instance->allocator = *allocator;
308     instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
309     instance->next_callback_handle = 0;
310 
311     for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) {
312         if (strcmp(create_info->ppEnabledExtensionNames[i],
313                    VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) {
314             ALOGV("instance extension '%s' requested",
315                   create_info->ppEnabledExtensionNames[i]);
316         } else if (strcmp(create_info->ppEnabledExtensionNames[i],
317                    VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) {
318             ALOGV("instance extension '%s' requested",
319                   create_info->ppEnabledExtensionNames[i]);
320         } else {
321             ALOGW("unsupported extension '%s' requested",
322                   create_info->ppEnabledExtensionNames[i]);
323         }
324     }
325 
326     *out_instance = instance;
327     return VK_SUCCESS;
328 }
329 
330 VKAPI_ATTR
GetInstanceProcAddr(VkInstance instance,const char * name)331 PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
332     return instance ? GetInstanceProcAddr(name) : GetGlobalProcAddr(name);
333 }
334 
335 VKAPI_ATTR
GetDeviceProcAddr(VkDevice,const char * name)336 PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) {
337     return GetInstanceProcAddr(name);
338 }
339 
340 // -----------------------------------------------------------------------------
341 // Instance
342 
DestroyInstance(VkInstance instance,const VkAllocationCallbacks *)343 void DestroyInstance(VkInstance instance,
344                      const VkAllocationCallbacks* /*allocator*/) {
345     instance->allocator.pfnFree(instance->allocator.pUserData, instance);
346 }
347 
348 // -----------------------------------------------------------------------------
349 // PhysicalDevice
350 
EnumeratePhysicalDevices(VkInstance instance,uint32_t * physical_device_count,VkPhysicalDevice * physical_devices)351 VkResult EnumeratePhysicalDevices(VkInstance instance,
352                                   uint32_t* physical_device_count,
353                                   VkPhysicalDevice* physical_devices) {
354     if (!physical_devices)
355         *physical_device_count = 1;
356     else if (*physical_device_count == 0)
357         return VK_INCOMPLETE;
358     else {
359         physical_devices[0] = &instance->physical_device;
360         *physical_device_count = 1;
361     }
362     return VK_SUCCESS;
363 }
364 
EnumerateDeviceLayerProperties(VkPhysicalDevice,uint32_t * count,VkLayerProperties *)365 VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice /*gpu*/,
366                                         uint32_t* count,
367                                         VkLayerProperties* /*properties*/) {
368     ALOGW("Driver vkEnumerateDeviceLayerProperties shouldn't be called");
369     *count = 0;
370     return VK_SUCCESS;
371 }
372 
EnumerateDeviceExtensionProperties(VkPhysicalDevice,const char * layer_name,uint32_t * count,VkExtensionProperties * properties)373 VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice /*gpu*/,
374                                             const char* layer_name,
375                                             uint32_t* count,
376                                             VkExtensionProperties* properties) {
377     if (layer_name) {
378         ALOGW(
379             "Driver vkEnumerateDeviceExtensionProperties shouldn't be called "
380             "with a layer name ('%s')",
381             layer_name);
382         *count = 0;
383         return VK_SUCCESS;
384     }
385 
386     const VkExtensionProperties kExtensions[] = {
387         {VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME,
388          VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION}};
389     const uint32_t kExtensionsCount =
390         sizeof(kExtensions) / sizeof(kExtensions[0]);
391 
392     if (!properties || *count > kExtensionsCount)
393         *count = kExtensionsCount;
394     if (properties)
395         std::copy(kExtensions, kExtensions + *count, properties);
396     return *count < kExtensionsCount ? VK_INCOMPLETE : VK_SUCCESS;
397 }
398 
GetPhysicalDeviceProperties(VkPhysicalDevice,VkPhysicalDeviceProperties * properties)399 void GetPhysicalDeviceProperties(VkPhysicalDevice,
400                                  VkPhysicalDeviceProperties* properties) {
401     properties->apiVersion = VK_MAKE_API_VERSION(0, 1, 2, VK_HEADER_VERSION);
402     properties->driverVersion = VK_MAKE_API_VERSION(0, 0, 0, 1);
403     properties->vendorID = 0;
404     properties->deviceID = 0;
405     properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
406     strcpy(properties->deviceName, "Android Vulkan Null Driver");
407     memset(properties->pipelineCacheUUID, 0,
408            sizeof(properties->pipelineCacheUUID));
409     properties->limits = VkPhysicalDeviceLimits{
410         4096,     // maxImageDimension1D
411         4096,     // maxImageDimension2D
412         256,      // maxImageDimension3D
413         4096,     // maxImageDimensionCube
414         256,      // maxImageArrayLayers
415         65536,    // maxTexelBufferElements
416         16384,    // maxUniformBufferRange
417         1 << 27,  // maxStorageBufferRange
418         128,      // maxPushConstantsSize
419         4096,     // maxMemoryAllocationCount
420         4000,     // maxSamplerAllocationCount
421         1,        // bufferImageGranularity
422         0,        // sparseAddressSpaceSize
423         4,        // maxBoundDescriptorSets
424         16,       // maxPerStageDescriptorSamplers
425         12,       // maxPerStageDescriptorUniformBuffers
426         4,        // maxPerStageDescriptorStorageBuffers
427         16,       // maxPerStageDescriptorSampledImages
428         4,        // maxPerStageDescriptorStorageImages
429         4,        // maxPerStageDescriptorInputAttachments
430         128,      // maxPerStageResources
431         96,       // maxDescriptorSetSamplers
432         72,       // maxDescriptorSetUniformBuffers
433         8,        // maxDescriptorSetUniformBuffersDynamic
434         24,       // maxDescriptorSetStorageBuffers
435         4,        // maxDescriptorSetStorageBuffersDynamic
436         96,       // maxDescriptorSetSampledImages
437         24,       // maxDescriptorSetStorageImages
438         4,        // maxDescriptorSetInputAttachments
439         16,       // maxVertexInputAttributes
440         16,       // maxVertexInputBindings
441         2047,     // maxVertexInputAttributeOffset
442         2048,     // maxVertexInputBindingStride
443         64,       // maxVertexOutputComponents
444         0,        // maxTessellationGenerationLevel
445         0,        // maxTessellationPatchSize
446         0,        // maxTessellationControlPerVertexInputComponents
447         0,        // maxTessellationControlPerVertexOutputComponents
448         0,        // maxTessellationControlPerPatchOutputComponents
449         0,        // maxTessellationControlTotalOutputComponents
450         0,        // maxTessellationEvaluationInputComponents
451         0,        // maxTessellationEvaluationOutputComponents
452         0,        // maxGeometryShaderInvocations
453         0,        // maxGeometryInputComponents
454         0,        // maxGeometryOutputComponents
455         0,        // maxGeometryOutputVertices
456         0,        // maxGeometryTotalOutputComponents
457         64,       // maxFragmentInputComponents
458         4,        // maxFragmentOutputAttachments
459         0,        // maxFragmentDualSrcAttachments
460         4,        // maxFragmentCombinedOutputResources
461         16384,    // maxComputeSharedMemorySize
462         {65536, 65536, 65536},  // maxComputeWorkGroupCount[3]
463         128,                    // maxComputeWorkGroupInvocations
464         {128, 128, 64},         // maxComputeWorkGroupSize[3]
465         4,                      // subPixelPrecisionBits
466         4,                      // subTexelPrecisionBits
467         4,                      // mipmapPrecisionBits
468         UINT32_MAX,             // maxDrawIndexedIndexValue
469         1,                      // maxDrawIndirectCount
470         2,                      // maxSamplerLodBias
471         1,                      // maxSamplerAnisotropy
472         1,                      // maxViewports
473         {4096, 4096},           // maxViewportDimensions[2]
474         {-8192.0f, 8191.0f},    // viewportBoundsRange[2]
475         0,                      // viewportSubPixelBits
476         64,                     // minMemoryMapAlignment
477         256,                    // minTexelBufferOffsetAlignment
478         256,                    // minUniformBufferOffsetAlignment
479         256,                    // minStorageBufferOffsetAlignment
480         -8,                     // minTexelOffset
481         7,                      // maxTexelOffset
482         0,                      // minTexelGatherOffset
483         0,                      // maxTexelGatherOffset
484         0.0f,                   // minInterpolationOffset
485         0.0f,                   // maxInterpolationOffset
486         0,                      // subPixelInterpolationOffsetBits
487         4096,                   // maxFramebufferWidth
488         4096,                   // maxFramebufferHeight
489         256,                    // maxFramebufferLayers
490         VK_SAMPLE_COUNT_1_BIT |
491             VK_SAMPLE_COUNT_4_BIT,  // framebufferColorSampleCounts
492         VK_SAMPLE_COUNT_1_BIT |
493             VK_SAMPLE_COUNT_4_BIT,  // framebufferDepthSampleCounts
494         VK_SAMPLE_COUNT_1_BIT |
495             VK_SAMPLE_COUNT_4_BIT,  // framebufferStencilSampleCounts
496         VK_SAMPLE_COUNT_1_BIT |
497             VK_SAMPLE_COUNT_4_BIT,  // framebufferNoAttachmentsSampleCounts
498         4,                          // maxColorAttachments
499         VK_SAMPLE_COUNT_1_BIT |
500             VK_SAMPLE_COUNT_4_BIT,  // sampledImageColorSampleCounts
501         VK_SAMPLE_COUNT_1_BIT,      // sampledImageIntegerSampleCounts
502         VK_SAMPLE_COUNT_1_BIT |
503             VK_SAMPLE_COUNT_4_BIT,  // sampledImageDepthSampleCounts
504         VK_SAMPLE_COUNT_1_BIT |
505             VK_SAMPLE_COUNT_4_BIT,  // sampledImageStencilSampleCounts
506         VK_SAMPLE_COUNT_1_BIT,      // storageImageSampleCounts
507         1,                          // maxSampleMaskWords
508         VK_TRUE,                    // timestampComputeAndGraphics
509         1,                          // timestampPeriod
510         0,                          // maxClipDistances
511         0,                          // maxCullDistances
512         0,                          // maxCombinedClipAndCullDistances
513         2,                          // discreteQueuePriorities
514         {1.0f, 1.0f},               // pointSizeRange[2]
515         {1.0f, 1.0f},               // lineWidthRange[2]
516         0.0f,                       // pointSizeGranularity
517         0.0f,                       // lineWidthGranularity
518         VK_TRUE,                    // strictLines
519         VK_TRUE,                    // standardSampleLocations
520         1,                          // optimalBufferCopyOffsetAlignment
521         1,                          // optimalBufferCopyRowPitchAlignment
522         64,                         // nonCoherentAtomSize
523     };
524 }
525 
GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physical_device,VkPhysicalDeviceProperties2KHR * properties)526 void GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physical_device,
527                                   VkPhysicalDeviceProperties2KHR* properties) {
528     GetPhysicalDeviceProperties(physical_device, &properties->properties);
529 
530     while (properties->pNext) {
531         properties = reinterpret_cast<VkPhysicalDeviceProperties2KHR *>(properties->pNext);
532 
533 #pragma clang diagnostic push
534 #pragma clang diagnostic ignored "-Wold-style-cast"
535         switch ((VkFlags)properties->sType) {
536         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID: {
537             VkPhysicalDevicePresentationPropertiesANDROID *presentation_properties =
538                 reinterpret_cast<VkPhysicalDevicePresentationPropertiesANDROID *>(properties);
539 #pragma clang diagnostic pop
540 
541                 // Claim that we do all the right things for the loader to
542                 // expose KHR_shared_presentable_image on our behalf.
543                 presentation_properties->sharedImage = VK_TRUE;
544             } break;
545 
546         default:
547             // Silently ignore other extension query structs
548             break;
549         }
550     }
551 }
552 
GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice,uint32_t * count,VkQueueFamilyProperties * properties)553 void GetPhysicalDeviceQueueFamilyProperties(
554     VkPhysicalDevice,
555     uint32_t* count,
556     VkQueueFamilyProperties* properties) {
557     if (!properties || *count > 1)
558         *count = 1;
559     if (properties && *count == 1) {
560         properties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT |
561                                  VK_QUEUE_TRANSFER_BIT;
562         properties->queueCount = 1;
563         properties->timestampValidBits = 64;
564         properties->minImageTransferGranularity = VkExtent3D{1, 1, 1};
565     }
566 }
567 
GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physical_device,uint32_t * count,VkQueueFamilyProperties2KHR * properties)568 void GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physical_device, uint32_t* count, VkQueueFamilyProperties2KHR* properties) {
569     // note: even though multiple structures, this is safe to forward in this
570     // case since we only expose one queue family.
571     GetPhysicalDeviceQueueFamilyProperties(physical_device, count, properties ? &properties->queueFamilyProperties : nullptr);
572 }
573 
GetPhysicalDeviceMemoryProperties(VkPhysicalDevice,VkPhysicalDeviceMemoryProperties * properties)574 void GetPhysicalDeviceMemoryProperties(
575     VkPhysicalDevice,
576     VkPhysicalDeviceMemoryProperties* properties) {
577     properties->memoryTypeCount = 1;
578     properties->memoryTypes[0].propertyFlags =
579         VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
580         VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
581         VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
582         VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
583     properties->memoryTypes[0].heapIndex = 0;
584     properties->memoryHeapCount = 1;
585     properties->memoryHeaps[0].size = kMaxDeviceMemory;
586     properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
587 }
588 
GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physical_device,VkPhysicalDeviceMemoryProperties2KHR * properties)589 void GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physical_device, VkPhysicalDeviceMemoryProperties2KHR* properties) {
590     GetPhysicalDeviceMemoryProperties(physical_device, &properties->memoryProperties);
591 }
592 
GetPhysicalDeviceFeatures(VkPhysicalDevice,VkPhysicalDeviceFeatures * features)593 void GetPhysicalDeviceFeatures(VkPhysicalDevice /*gpu*/,
594                                VkPhysicalDeviceFeatures* features) {
595     *features = VkPhysicalDeviceFeatures{
596         VK_TRUE,   // robustBufferAccess
597         VK_FALSE,  // fullDrawIndexUint32
598         VK_FALSE,  // imageCubeArray
599         VK_FALSE,  // independentBlend
600         VK_FALSE,  // geometryShader
601         VK_FALSE,  // tessellationShader
602         VK_FALSE,  // sampleRateShading
603         VK_FALSE,  // dualSrcBlend
604         VK_FALSE,  // logicOp
605         VK_FALSE,  // multiDrawIndirect
606         VK_FALSE,  // drawIndirectFirstInstance
607         VK_FALSE,  // depthClamp
608         VK_FALSE,  // depthBiasClamp
609         VK_FALSE,  // fillModeNonSolid
610         VK_FALSE,  // depthBounds
611         VK_FALSE,  // wideLines
612         VK_FALSE,  // largePoints
613         VK_FALSE,  // alphaToOne
614         VK_FALSE,  // multiViewport
615         VK_FALSE,  // samplerAnisotropy
616         VK_FALSE,  // textureCompressionETC2
617         VK_FALSE,  // textureCompressionASTC_LDR
618         VK_FALSE,  // textureCompressionBC
619         VK_FALSE,  // occlusionQueryPrecise
620         VK_FALSE,  // pipelineStatisticsQuery
621         VK_FALSE,  // vertexPipelineStoresAndAtomics
622         VK_FALSE,  // fragmentStoresAndAtomics
623         VK_FALSE,  // shaderTessellationAndGeometryPointSize
624         VK_FALSE,  // shaderImageGatherExtended
625         VK_FALSE,  // shaderStorageImageExtendedFormats
626         VK_FALSE,  // shaderStorageImageMultisample
627         VK_FALSE,  // shaderStorageImageReadWithoutFormat
628         VK_FALSE,  // shaderStorageImageWriteWithoutFormat
629         VK_FALSE,  // shaderUniformBufferArrayDynamicIndexing
630         VK_FALSE,  // shaderSampledImageArrayDynamicIndexing
631         VK_FALSE,  // shaderStorageBufferArrayDynamicIndexing
632         VK_FALSE,  // shaderStorageImageArrayDynamicIndexing
633         VK_FALSE,  // shaderClipDistance
634         VK_FALSE,  // shaderCullDistance
635         VK_FALSE,  // shaderFloat64
636         VK_FALSE,  // shaderInt64
637         VK_FALSE,  // shaderInt16
638         VK_FALSE,  // shaderResourceResidency
639         VK_FALSE,  // shaderResourceMinLod
640         VK_FALSE,  // sparseBinding
641         VK_FALSE,  // sparseResidencyBuffer
642         VK_FALSE,  // sparseResidencyImage2D
643         VK_FALSE,  // sparseResidencyImage3D
644         VK_FALSE,  // sparseResidency2Samples
645         VK_FALSE,  // sparseResidency4Samples
646         VK_FALSE,  // sparseResidency8Samples
647         VK_FALSE,  // sparseResidency16Samples
648         VK_FALSE,  // sparseResidencyAliased
649         VK_FALSE,  // variableMultisampleRate
650         VK_FALSE,  // inheritedQueries
651     };
652 }
653 
GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physical_device,VkPhysicalDeviceFeatures2KHR * features)654 void GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physical_device, VkPhysicalDeviceFeatures2KHR* features) {
655     GetPhysicalDeviceFeatures(physical_device, &features->features);
656 }
657 
658 // -----------------------------------------------------------------------------
659 // Device
660 
CreateDevice(VkPhysicalDevice physical_device,const VkDeviceCreateInfo * create_info,const VkAllocationCallbacks * allocator,VkDevice * out_device)661 VkResult CreateDevice(VkPhysicalDevice physical_device,
662                       const VkDeviceCreateInfo* create_info,
663                       const VkAllocationCallbacks* allocator,
664                       VkDevice* out_device) {
665     VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device);
666     if (!allocator)
667         allocator = &instance->allocator;
668     VkDevice_T* device = static_cast<VkDevice_T*>(allocator->pfnAllocation(
669         allocator->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T),
670         VK_SYSTEM_ALLOCATION_SCOPE_DEVICE));
671     if (!device)
672         return VK_ERROR_OUT_OF_HOST_MEMORY;
673 
674     device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
675     device->allocator = *allocator;
676     device->instance = instance;
677     device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
678     std::fill(device->next_handle.begin(), device->next_handle.end(),
679               UINT64_C(0));
680 
681     for (uint32_t i = 0; i < create_info->enabledExtensionCount; i++) {
682         if (strcmp(create_info->ppEnabledExtensionNames[i],
683                    VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME) == 0) {
684             ALOGV("Enabling " VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME);
685         }
686     }
687 
688     *out_device = device;
689     return VK_SUCCESS;
690 }
691 
DestroyDevice(VkDevice device,const VkAllocationCallbacks *)692 void DestroyDevice(VkDevice device,
693                    const VkAllocationCallbacks* /*allocator*/) {
694     if (!device)
695         return;
696     device->allocator.pfnFree(device->allocator.pUserData, device);
697 }
698 
GetDeviceQueue(VkDevice device,uint32_t,uint32_t,VkQueue * queue)699 void GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) {
700     *queue = &device->queue;
701 }
702 
703 // -----------------------------------------------------------------------------
704 // CommandPool
705 
706 struct CommandPool {
707     typedef VkCommandPool HandleType;
708     VkAllocationCallbacks allocator;
709 };
DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool)710 DEFINE_OBJECT_HANDLE_CONVERSION(CommandPool)
711 
712 VkResult CreateCommandPool(VkDevice device,
713                            const VkCommandPoolCreateInfo* /*create_info*/,
714                            const VkAllocationCallbacks* allocator,
715                            VkCommandPool* cmd_pool) {
716     if (!allocator)
717         allocator = &device->allocator;
718     CommandPool* pool = static_cast<CommandPool*>(allocator->pfnAllocation(
719         allocator->pUserData, sizeof(CommandPool), alignof(CommandPool),
720         VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
721     if (!pool)
722         return VK_ERROR_OUT_OF_HOST_MEMORY;
723     pool->allocator = *allocator;
724     *cmd_pool = GetHandleToCommandPool(pool);
725     return VK_SUCCESS;
726 }
727 
DestroyCommandPool(VkDevice,VkCommandPool cmd_pool,const VkAllocationCallbacks *)728 void DestroyCommandPool(VkDevice /*device*/,
729                         VkCommandPool cmd_pool,
730                         const VkAllocationCallbacks* /*allocator*/) {
731     CommandPool* pool = GetCommandPoolFromHandle(cmd_pool);
732     pool->allocator.pfnFree(pool->allocator.pUserData, pool);
733 }
734 
735 // -----------------------------------------------------------------------------
736 // CmdBuffer
737 
AllocateCommandBuffers(VkDevice,const VkCommandBufferAllocateInfo * alloc_info,VkCommandBuffer * cmdbufs)738 VkResult AllocateCommandBuffers(VkDevice /*device*/,
739                                 const VkCommandBufferAllocateInfo* alloc_info,
740                                 VkCommandBuffer* cmdbufs) {
741     VkResult result = VK_SUCCESS;
742     CommandPool& pool = *GetCommandPoolFromHandle(alloc_info->commandPool);
743     std::fill(cmdbufs, cmdbufs + alloc_info->commandBufferCount, nullptr);
744     for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) {
745         cmdbufs[i] =
746             static_cast<VkCommandBuffer_T*>(pool.allocator.pfnAllocation(
747                 pool.allocator.pUserData, sizeof(VkCommandBuffer_T),
748                 alignof(VkCommandBuffer_T), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
749         if (!cmdbufs[i]) {
750             result = VK_ERROR_OUT_OF_HOST_MEMORY;
751             break;
752         }
753         cmdbufs[i]->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
754     }
755     if (result != VK_SUCCESS) {
756         for (uint32_t i = 0; i < alloc_info->commandBufferCount; i++) {
757             if (!cmdbufs[i])
758                 break;
759             pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
760         }
761     }
762     return result;
763 }
764 
FreeCommandBuffers(VkDevice,VkCommandPool cmd_pool,uint32_t count,const VkCommandBuffer * cmdbufs)765 void FreeCommandBuffers(VkDevice /*device*/,
766                         VkCommandPool cmd_pool,
767                         uint32_t count,
768                         const VkCommandBuffer* cmdbufs) {
769     CommandPool& pool = *GetCommandPoolFromHandle(cmd_pool);
770     for (uint32_t i = 0; i < count; i++)
771         pool.allocator.pfnFree(pool.allocator.pUserData, cmdbufs[i]);
772 }
773 
774 // -----------------------------------------------------------------------------
775 // DeviceMemory
776 
777 struct DeviceMemory {
778     typedef VkDeviceMemory HandleType;
779     VkDeviceSize size;
780     alignas(16) uint8_t data[0];
781 };
DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory)782 DEFINE_OBJECT_HANDLE_CONVERSION(DeviceMemory)
783 
784 VkResult AllocateMemory(VkDevice device,
785                         const VkMemoryAllocateInfo* alloc_info,
786                         const VkAllocationCallbacks* allocator,
787                         VkDeviceMemory* mem_handle) {
788     if (SIZE_MAX - sizeof(DeviceMemory) <= alloc_info->allocationSize)
789         return VK_ERROR_OUT_OF_HOST_MEMORY;
790     if (!allocator)
791         allocator = &device->allocator;
792 
793     size_t size = sizeof(DeviceMemory) + size_t(alloc_info->allocationSize);
794     DeviceMemory* mem = static_cast<DeviceMemory*>(allocator->pfnAllocation(
795         allocator->pUserData, size, alignof(DeviceMemory),
796         VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
797     if (!mem)
798         return VK_ERROR_OUT_OF_HOST_MEMORY;
799     mem->size = size;
800     *mem_handle = GetHandleToDeviceMemory(mem);
801     return VK_SUCCESS;
802 }
803 
FreeMemory(VkDevice device,VkDeviceMemory mem_handle,const VkAllocationCallbacks * allocator)804 void FreeMemory(VkDevice device,
805                 VkDeviceMemory mem_handle,
806                 const VkAllocationCallbacks* allocator) {
807     if (!allocator)
808         allocator = &device->allocator;
809     DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
810     allocator->pfnFree(allocator->pUserData, mem);
811 }
812 
MapMemory(VkDevice,VkDeviceMemory mem_handle,VkDeviceSize offset,VkDeviceSize,VkMemoryMapFlags,void ** out_ptr)813 VkResult MapMemory(VkDevice,
814                    VkDeviceMemory mem_handle,
815                    VkDeviceSize offset,
816                    VkDeviceSize,
817                    VkMemoryMapFlags,
818                    void** out_ptr) {
819     DeviceMemory* mem = GetDeviceMemoryFromHandle(mem_handle);
820     *out_ptr = &mem->data[0] + offset;
821     return VK_SUCCESS;
822 }
823 
824 // -----------------------------------------------------------------------------
825 // Buffer
826 
827 struct Buffer {
828     typedef VkBuffer HandleType;
829     VkDeviceSize size;
830 };
DEFINE_OBJECT_HANDLE_CONVERSION(Buffer)831 DEFINE_OBJECT_HANDLE_CONVERSION(Buffer)
832 
833 VkResult CreateBuffer(VkDevice device,
834                       const VkBufferCreateInfo* create_info,
835                       const VkAllocationCallbacks* allocator,
836                       VkBuffer* buffer_handle) {
837     ALOGW_IF(create_info->size > kMaxDeviceMemory,
838              "CreateBuffer: requested size 0x%" PRIx64
839              " exceeds max device memory size 0x%" PRIx64,
840              create_info->size, kMaxDeviceMemory);
841     if (!allocator)
842         allocator = &device->allocator;
843     Buffer* buffer = static_cast<Buffer*>(allocator->pfnAllocation(
844         allocator->pUserData, sizeof(Buffer), alignof(Buffer),
845         VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
846     if (!buffer)
847         return VK_ERROR_OUT_OF_HOST_MEMORY;
848     buffer->size = create_info->size;
849     *buffer_handle = GetHandleToBuffer(buffer);
850     return VK_SUCCESS;
851 }
852 
GetBufferMemoryRequirements(VkDevice,VkBuffer buffer_handle,VkMemoryRequirements * requirements)853 void GetBufferMemoryRequirements(VkDevice,
854                                  VkBuffer buffer_handle,
855                                  VkMemoryRequirements* requirements) {
856     Buffer* buffer = GetBufferFromHandle(buffer_handle);
857     requirements->size = buffer->size;
858     requirements->alignment = 16;  // allow fast Neon/SSE memcpy
859     requirements->memoryTypeBits = 0x1;
860 }
861 
DestroyBuffer(VkDevice device,VkBuffer buffer_handle,const VkAllocationCallbacks * allocator)862 void DestroyBuffer(VkDevice device,
863                    VkBuffer buffer_handle,
864                    const VkAllocationCallbacks* allocator) {
865     if (!allocator)
866         allocator = &device->allocator;
867     Buffer* buffer = GetBufferFromHandle(buffer_handle);
868     allocator->pfnFree(allocator->pUserData, buffer);
869 }
870 
871 // -----------------------------------------------------------------------------
872 // Image
873 
874 struct Image {
875     typedef VkImage HandleType;
876     VkDeviceSize size;
877 };
DEFINE_OBJECT_HANDLE_CONVERSION(Image)878 DEFINE_OBJECT_HANDLE_CONVERSION(Image)
879 
880 VkResult CreateImage(VkDevice device,
881                      const VkImageCreateInfo* create_info,
882                      const VkAllocationCallbacks* allocator,
883                      VkImage* image_handle) {
884     if (create_info->imageType != VK_IMAGE_TYPE_2D ||
885         create_info->format != VK_FORMAT_R8G8B8A8_UNORM ||
886         create_info->mipLevels != 1) {
887         ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u",
888               create_info->imageType, create_info->format,
889               create_info->mipLevels);
890         return VK_ERROR_OUT_OF_HOST_MEMORY;
891     }
892 
893     VkDeviceSize size =
894         VkDeviceSize(create_info->extent.width * create_info->extent.height) *
895         create_info->arrayLayers * create_info->samples * 4u;
896     ALOGW_IF(size > kMaxDeviceMemory,
897              "CreateImage: image size 0x%" PRIx64
898              " exceeds max device memory size 0x%" PRIx64,
899              size, kMaxDeviceMemory);
900 
901     if (!allocator)
902         allocator = &device->allocator;
903     Image* image = static_cast<Image*>(allocator->pfnAllocation(
904         allocator->pUserData, sizeof(Image), alignof(Image),
905         VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
906     if (!image)
907         return VK_ERROR_OUT_OF_HOST_MEMORY;
908     image->size = size;
909     *image_handle = GetHandleToImage(image);
910     return VK_SUCCESS;
911 }
912 
GetImageMemoryRequirements(VkDevice,VkImage image_handle,VkMemoryRequirements * requirements)913 void GetImageMemoryRequirements(VkDevice,
914                                 VkImage image_handle,
915                                 VkMemoryRequirements* requirements) {
916     Image* image = GetImageFromHandle(image_handle);
917     requirements->size = image->size;
918     requirements->alignment = 16;  // allow fast Neon/SSE memcpy
919     requirements->memoryTypeBits = 0x1;
920 }
921 
DestroyImage(VkDevice device,VkImage image_handle,const VkAllocationCallbacks * allocator)922 void DestroyImage(VkDevice device,
923                   VkImage image_handle,
924                   const VkAllocationCallbacks* allocator) {
925     if (!allocator)
926         allocator = &device->allocator;
927     Image* image = GetImageFromHandle(image_handle);
928     allocator->pfnFree(allocator->pUserData, image);
929 }
930 
GetSwapchainGrallocUsageANDROID(VkDevice,VkFormat,VkImageUsageFlags,int * grallocUsage)931 VkResult GetSwapchainGrallocUsageANDROID(VkDevice,
932                                          VkFormat,
933                                          VkImageUsageFlags,
934                                          int* grallocUsage) {
935     // The null driver never reads or writes the gralloc buffer
936     *grallocUsage = 0;
937     return VK_SUCCESS;
938 }
939 
GetSwapchainGrallocUsage2ANDROID(VkDevice,VkFormat,VkImageUsageFlags,VkSwapchainImageUsageFlagsANDROID,uint64_t * grallocConsumerUsage,uint64_t * grallocProducerUsage)940 VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice,
941                                           VkFormat,
942                                           VkImageUsageFlags,
943                                           VkSwapchainImageUsageFlagsANDROID,
944                                           uint64_t* grallocConsumerUsage,
945                                           uint64_t* grallocProducerUsage) {
946     // The null driver never reads or writes the gralloc buffer
947     *grallocConsumerUsage = 0;
948     *grallocProducerUsage = 0;
949     return VK_SUCCESS;
950 }
951 
GetSwapchainGrallocUsage3ANDROID(VkDevice,const VkGrallocUsageInfoANDROID * grallocUsageInfo,uint64_t * grallocUsage)952 VkResult GetSwapchainGrallocUsage3ANDROID(
953     VkDevice,
954     const VkGrallocUsageInfoANDROID* grallocUsageInfo,
955     uint64_t* grallocUsage) {
956     // The null driver never reads or writes the gralloc buffer
957     ALOGV("TODO: vk%s - grallocUsageInfo->format:%i", __FUNCTION__,
958           grallocUsageInfo->format);
959     *grallocUsage = 0;
960     return VK_SUCCESS;
961 }
962 
GetSwapchainGrallocUsage4ANDROID(VkDevice,const VkGrallocUsageInfo2ANDROID * grallocUsageInfo,uint64_t * grallocUsage)963 VkResult GetSwapchainGrallocUsage4ANDROID(
964     VkDevice,
965     const VkGrallocUsageInfo2ANDROID* grallocUsageInfo,
966     uint64_t* grallocUsage) {
967     // The null driver never reads or writes the gralloc buffer
968     ALOGV("TODO: vk%s - grallocUsageInfo->format:%i", __FUNCTION__,
969           grallocUsageInfo->format);
970     *grallocUsage = 0;
971     return VK_SUCCESS;
972 }
973 
AcquireImageANDROID(VkDevice,VkImage,int fence,VkSemaphore,VkFence)974 VkResult AcquireImageANDROID(VkDevice,
975                              VkImage,
976                              int fence,
977                              VkSemaphore,
978                              VkFence) {
979     close(fence);
980     return VK_SUCCESS;
981 }
982 
QueueSignalReleaseImageANDROID(VkQueue,uint32_t,const VkSemaphore *,VkImage,int * fence)983 VkResult QueueSignalReleaseImageANDROID(VkQueue,
984                                         uint32_t,
985                                         const VkSemaphore*,
986                                         VkImage,
987                                         int* fence) {
988     *fence = -1;
989     return VK_SUCCESS;
990 }
991 
992 // -----------------------------------------------------------------------------
993 // No-op types
994 
CreateBufferView(VkDevice device,const VkBufferViewCreateInfo *,const VkAllocationCallbacks *,VkBufferView * view)995 VkResult CreateBufferView(VkDevice device,
996                           const VkBufferViewCreateInfo*,
997                           const VkAllocationCallbacks* /*allocator*/,
998                           VkBufferView* view) {
999     *view = AllocHandle<VkBufferView>(device, HandleType::kBufferView);
1000     return VK_SUCCESS;
1001 }
1002 
CreateDescriptorPool(VkDevice device,const VkDescriptorPoolCreateInfo *,const VkAllocationCallbacks *,VkDescriptorPool * pool)1003 VkResult CreateDescriptorPool(VkDevice device,
1004                               const VkDescriptorPoolCreateInfo*,
1005                               const VkAllocationCallbacks* /*allocator*/,
1006                               VkDescriptorPool* pool) {
1007     *pool = AllocHandle<VkDescriptorPool>(device, HandleType::kDescriptorPool);
1008     return VK_SUCCESS;
1009 }
1010 
AllocateDescriptorSets(VkDevice device,const VkDescriptorSetAllocateInfo * alloc_info,VkDescriptorSet * descriptor_sets)1011 VkResult AllocateDescriptorSets(VkDevice device,
1012                                 const VkDescriptorSetAllocateInfo* alloc_info,
1013                                 VkDescriptorSet* descriptor_sets) {
1014     for (uint32_t i = 0; i < alloc_info->descriptorSetCount; i++)
1015         descriptor_sets[i] =
1016             AllocHandle<VkDescriptorSet>(device, HandleType::kDescriptorSet);
1017     return VK_SUCCESS;
1018 }
1019 
CreateDescriptorSetLayout(VkDevice device,const VkDescriptorSetLayoutCreateInfo *,const VkAllocationCallbacks *,VkDescriptorSetLayout * layout)1020 VkResult CreateDescriptorSetLayout(VkDevice device,
1021                                    const VkDescriptorSetLayoutCreateInfo*,
1022                                    const VkAllocationCallbacks* /*allocator*/,
1023                                    VkDescriptorSetLayout* layout) {
1024     *layout = AllocHandle<VkDescriptorSetLayout>(
1025         device, HandleType::kDescriptorSetLayout);
1026     return VK_SUCCESS;
1027 }
1028 
CreateEvent(VkDevice device,const VkEventCreateInfo *,const VkAllocationCallbacks *,VkEvent * event)1029 VkResult CreateEvent(VkDevice device,
1030                      const VkEventCreateInfo*,
1031                      const VkAllocationCallbacks* /*allocator*/,
1032                      VkEvent* event) {
1033     *event = AllocHandle<VkEvent>(device, HandleType::kEvent);
1034     return VK_SUCCESS;
1035 }
1036 
CreateFence(VkDevice device,const VkFenceCreateInfo *,const VkAllocationCallbacks *,VkFence * fence)1037 VkResult CreateFence(VkDevice device,
1038                      const VkFenceCreateInfo*,
1039                      const VkAllocationCallbacks* /*allocator*/,
1040                      VkFence* fence) {
1041     *fence = AllocHandle<VkFence>(device, HandleType::kFence);
1042     return VK_SUCCESS;
1043 }
1044 
CreateFramebuffer(VkDevice device,const VkFramebufferCreateInfo *,const VkAllocationCallbacks *,VkFramebuffer * framebuffer)1045 VkResult CreateFramebuffer(VkDevice device,
1046                            const VkFramebufferCreateInfo*,
1047                            const VkAllocationCallbacks* /*allocator*/,
1048                            VkFramebuffer* framebuffer) {
1049     *framebuffer = AllocHandle<VkFramebuffer>(device, HandleType::kFramebuffer);
1050     return VK_SUCCESS;
1051 }
1052 
CreateImageView(VkDevice device,const VkImageViewCreateInfo *,const VkAllocationCallbacks *,VkImageView * view)1053 VkResult CreateImageView(VkDevice device,
1054                          const VkImageViewCreateInfo*,
1055                          const VkAllocationCallbacks* /*allocator*/,
1056                          VkImageView* view) {
1057     *view = AllocHandle<VkImageView>(device, HandleType::kImageView);
1058     return VK_SUCCESS;
1059 }
1060 
CreateGraphicsPipelines(VkDevice device,VkPipelineCache,uint32_t count,const VkGraphicsPipelineCreateInfo *,const VkAllocationCallbacks *,VkPipeline * pipelines)1061 VkResult CreateGraphicsPipelines(VkDevice device,
1062                                  VkPipelineCache,
1063                                  uint32_t count,
1064                                  const VkGraphicsPipelineCreateInfo*,
1065                                  const VkAllocationCallbacks* /*allocator*/,
1066                                  VkPipeline* pipelines) {
1067     for (uint32_t i = 0; i < count; i++)
1068         pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline);
1069     return VK_SUCCESS;
1070 }
1071 
CreateComputePipelines(VkDevice device,VkPipelineCache,uint32_t count,const VkComputePipelineCreateInfo *,const VkAllocationCallbacks *,VkPipeline * pipelines)1072 VkResult CreateComputePipelines(VkDevice device,
1073                                 VkPipelineCache,
1074                                 uint32_t count,
1075                                 const VkComputePipelineCreateInfo*,
1076                                 const VkAllocationCallbacks* /*allocator*/,
1077                                 VkPipeline* pipelines) {
1078     for (uint32_t i = 0; i < count; i++)
1079         pipelines[i] = AllocHandle<VkPipeline>(device, HandleType::kPipeline);
1080     return VK_SUCCESS;
1081 }
1082 
CreatePipelineCache(VkDevice device,const VkPipelineCacheCreateInfo *,const VkAllocationCallbacks *,VkPipelineCache * cache)1083 VkResult CreatePipelineCache(VkDevice device,
1084                              const VkPipelineCacheCreateInfo*,
1085                              const VkAllocationCallbacks* /*allocator*/,
1086                              VkPipelineCache* cache) {
1087     *cache = AllocHandle<VkPipelineCache>(device, HandleType::kPipelineCache);
1088     return VK_SUCCESS;
1089 }
1090 
CreatePipelineLayout(VkDevice device,const VkPipelineLayoutCreateInfo *,const VkAllocationCallbacks *,VkPipelineLayout * layout)1091 VkResult CreatePipelineLayout(VkDevice device,
1092                               const VkPipelineLayoutCreateInfo*,
1093                               const VkAllocationCallbacks* /*allocator*/,
1094                               VkPipelineLayout* layout) {
1095     *layout =
1096         AllocHandle<VkPipelineLayout>(device, HandleType::kPipelineLayout);
1097     return VK_SUCCESS;
1098 }
1099 
CreateQueryPool(VkDevice device,const VkQueryPoolCreateInfo *,const VkAllocationCallbacks *,VkQueryPool * pool)1100 VkResult CreateQueryPool(VkDevice device,
1101                          const VkQueryPoolCreateInfo*,
1102                          const VkAllocationCallbacks* /*allocator*/,
1103                          VkQueryPool* pool) {
1104     *pool = AllocHandle<VkQueryPool>(device, HandleType::kQueryPool);
1105     return VK_SUCCESS;
1106 }
1107 
CreateRenderPass(VkDevice device,const VkRenderPassCreateInfo *,const VkAllocationCallbacks *,VkRenderPass * renderpass)1108 VkResult CreateRenderPass(VkDevice device,
1109                           const VkRenderPassCreateInfo*,
1110                           const VkAllocationCallbacks* /*allocator*/,
1111                           VkRenderPass* renderpass) {
1112     *renderpass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass);
1113     return VK_SUCCESS;
1114 }
1115 
CreateSampler(VkDevice device,const VkSamplerCreateInfo *,const VkAllocationCallbacks *,VkSampler * sampler)1116 VkResult CreateSampler(VkDevice device,
1117                        const VkSamplerCreateInfo*,
1118                        const VkAllocationCallbacks* /*allocator*/,
1119                        VkSampler* sampler) {
1120     *sampler = AllocHandle<VkSampler>(device, HandleType::kSampler);
1121     return VK_SUCCESS;
1122 }
1123 
CreateSemaphore(VkDevice device,const VkSemaphoreCreateInfo *,const VkAllocationCallbacks *,VkSemaphore * semaphore)1124 VkResult CreateSemaphore(VkDevice device,
1125                          const VkSemaphoreCreateInfo*,
1126                          const VkAllocationCallbacks* /*allocator*/,
1127                          VkSemaphore* semaphore) {
1128     *semaphore = AllocHandle<VkSemaphore>(device, HandleType::kSemaphore);
1129     return VK_SUCCESS;
1130 }
1131 
CreateShaderModule(VkDevice device,const VkShaderModuleCreateInfo *,const VkAllocationCallbacks *,VkShaderModule * module)1132 VkResult CreateShaderModule(VkDevice device,
1133                             const VkShaderModuleCreateInfo*,
1134                             const VkAllocationCallbacks* /*allocator*/,
1135                             VkShaderModule* module) {
1136     *module = AllocHandle<VkShaderModule>(device, HandleType::kShaderModule);
1137     return VK_SUCCESS;
1138 }
1139 
CreateDebugReportCallbackEXT(VkInstance instance,const VkDebugReportCallbackCreateInfoEXT *,const VkAllocationCallbacks *,VkDebugReportCallbackEXT * callback)1140 VkResult CreateDebugReportCallbackEXT(VkInstance instance,
1141                                       const VkDebugReportCallbackCreateInfoEXT*,
1142                                       const VkAllocationCallbacks*,
1143                                       VkDebugReportCallbackEXT* callback) {
1144     *callback = AllocHandle<VkDebugReportCallbackEXT>(
1145         instance, HandleType::kDebugReportCallbackEXT);
1146     return VK_SUCCESS;
1147 }
1148 
CreateRenderPass2(VkDevice device,const VkRenderPassCreateInfo2 *,const VkAllocationCallbacks *,VkRenderPass * pRenderPass)1149 VkResult CreateRenderPass2(VkDevice device,
1150                            const VkRenderPassCreateInfo2*,
1151                            const VkAllocationCallbacks* /*allocator*/,
1152                            VkRenderPass* pRenderPass) {
1153     *pRenderPass = AllocHandle<VkRenderPass>(device, HandleType::kRenderPass);
1154     return VK_SUCCESS;
1155 }
1156 
1157 // -----------------------------------------------------------------------------
1158 // No-op entrypoints
1159 
1160 // clang-format off
1161 #pragma clang diagnostic push
1162 #pragma clang diagnostic ignored "-Wunused-parameter"
1163 
GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice,VkFormat format,VkFormatProperties * pFormatProperties)1164 void GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {
1165     ALOGV("TODO: vk%s", __FUNCTION__);
1166 }
1167 
GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice,VkFormat format,VkFormatProperties2KHR * pFormatProperties)1168 void GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR* pFormatProperties) {
1169     ALOGV("TODO: vk%s", __FUNCTION__);
1170 }
1171 
GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice,VkFormat format,VkImageType type,VkImageTiling tiling,VkImageUsageFlags usage,VkImageCreateFlags flags,VkImageFormatProperties * pImageFormatProperties)1172 VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
1173     ALOGV("TODO: vk%s", __FUNCTION__);
1174     return VK_SUCCESS;
1175 }
1176 
GetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceImageFormatInfo2KHR * pImageFormatInfo,VkImageFormatProperties2KHR * pImageFormatProperties)1177 VkResult GetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,
1178                                                     const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
1179                                                     VkImageFormatProperties2KHR* pImageFormatProperties) {
1180     ALOGV("TODO: vk%s", __FUNCTION__);
1181     return VK_SUCCESS;
1182 }
1183 
EnumerateInstanceLayerProperties(uint32_t * pCount,VkLayerProperties * pProperties)1184 VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
1185     ALOGV("TODO: vk%s", __FUNCTION__);
1186     return VK_SUCCESS;
1187 }
1188 
QueueSubmit(VkQueue queue,uint32_t submitCount,const VkSubmitInfo * pSubmitInfo,VkFence fence)1189 VkResult QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmitInfo, VkFence fence) {
1190     return VK_SUCCESS;
1191 }
1192 
QueueWaitIdle(VkQueue queue)1193 VkResult QueueWaitIdle(VkQueue queue) {
1194     ALOGV("TODO: vk%s", __FUNCTION__);
1195     return VK_SUCCESS;
1196 }
1197 
DeviceWaitIdle(VkDevice device)1198 VkResult DeviceWaitIdle(VkDevice device) {
1199     ALOGV("TODO: vk%s", __FUNCTION__);
1200     return VK_SUCCESS;
1201 }
1202 
UnmapMemory(VkDevice device,VkDeviceMemory mem)1203 void UnmapMemory(VkDevice device, VkDeviceMemory mem) {
1204 }
1205 
FlushMappedMemoryRanges(VkDevice device,uint32_t memRangeCount,const VkMappedMemoryRange * pMemRanges)1206 VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
1207     ALOGV("TODO: vk%s", __FUNCTION__);
1208     return VK_SUCCESS;
1209 }
1210 
InvalidateMappedMemoryRanges(VkDevice device,uint32_t memRangeCount,const VkMappedMemoryRange * pMemRanges)1211 VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
1212     ALOGV("TODO: vk%s", __FUNCTION__);
1213     return VK_SUCCESS;
1214 }
1215 
GetDeviceMemoryCommitment(VkDevice device,VkDeviceMemory memory,VkDeviceSize * pCommittedMemoryInBytes)1216 void GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {
1217     ALOGV("TODO: vk%s", __FUNCTION__);
1218 }
1219 
BindBufferMemory(VkDevice device,VkBuffer buffer,VkDeviceMemory mem,VkDeviceSize memOffset)1220 VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) {
1221     return VK_SUCCESS;
1222 }
1223 
BindImageMemory(VkDevice device,VkImage image,VkDeviceMemory mem,VkDeviceSize memOffset)1224 VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) {
1225     return VK_SUCCESS;
1226 }
1227 
GetImageSparseMemoryRequirements(VkDevice device,VkImage image,uint32_t * pNumRequirements,VkSparseImageMemoryRequirements * pSparseMemoryRequirements)1228 void GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
1229     ALOGV("TODO: vk%s", __FUNCTION__);
1230 }
1231 
GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice,VkFormat format,VkImageType type,VkSampleCountFlagBits samples,VkImageUsageFlags usage,VkImageTiling tiling,uint32_t * pNumProperties,VkSparseImageFormatProperties * pProperties)1232 void GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties) {
1233     ALOGV("TODO: vk%s", __FUNCTION__);
1234 }
1235 
GetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,VkPhysicalDeviceSparseImageFormatInfo2KHR const * pInfo,unsigned int * pNumProperties,VkSparseImageFormatProperties2KHR * pProperties)1236 void GetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,
1237                                                       VkPhysicalDeviceSparseImageFormatInfo2KHR const* pInfo,
1238                                                       unsigned int* pNumProperties,
1239                                                       VkSparseImageFormatProperties2KHR* pProperties) {
1240     ALOGV("TODO: vk%s", __FUNCTION__);
1241 }
1242 
1243 
QueueBindSparse(VkQueue queue,uint32_t bindInfoCount,const VkBindSparseInfo * pBindInfo,VkFence fence)1244 VkResult QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {
1245     ALOGV("TODO: vk%s", __FUNCTION__);
1246     return VK_SUCCESS;
1247 }
1248 
DestroyFence(VkDevice device,VkFence fence,const VkAllocationCallbacks * allocator)1249 void DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* allocator) {
1250 }
1251 
ResetFences(VkDevice device,uint32_t fenceCount,const VkFence * pFences)1252 VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
1253     return VK_SUCCESS;
1254 }
1255 
GetFenceStatus(VkDevice device,VkFence fence)1256 VkResult GetFenceStatus(VkDevice device, VkFence fence) {
1257     ALOGV("TODO: vk%s", __FUNCTION__);
1258     return VK_SUCCESS;
1259 }
1260 
WaitForFences(VkDevice device,uint32_t fenceCount,const VkFence * pFences,VkBool32 waitAll,uint64_t timeout)1261 VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {
1262     return VK_SUCCESS;
1263 }
1264 
DestroySemaphore(VkDevice device,VkSemaphore semaphore,const VkAllocationCallbacks * allocator)1265 void DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* allocator) {
1266 }
1267 
DestroyEvent(VkDevice device,VkEvent event,const VkAllocationCallbacks * allocator)1268 void DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* allocator) {
1269 }
1270 
GetEventStatus(VkDevice device,VkEvent event)1271 VkResult GetEventStatus(VkDevice device, VkEvent event) {
1272     ALOGV("TODO: vk%s", __FUNCTION__);
1273     return VK_SUCCESS;
1274 }
1275 
SetEvent(VkDevice device,VkEvent event)1276 VkResult SetEvent(VkDevice device, VkEvent event) {
1277     ALOGV("TODO: vk%s", __FUNCTION__);
1278     return VK_SUCCESS;
1279 }
1280 
ResetEvent(VkDevice device,VkEvent event)1281 VkResult ResetEvent(VkDevice device, VkEvent event) {
1282     ALOGV("TODO: vk%s", __FUNCTION__);
1283     return VK_SUCCESS;
1284 }
1285 
DestroyQueryPool(VkDevice device,VkQueryPool queryPool,const VkAllocationCallbacks * allocator)1286 void DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* allocator) {
1287 }
1288 
GetQueryPoolResults(VkDevice device,VkQueryPool queryPool,uint32_t startQuery,uint32_t queryCount,size_t dataSize,void * pData,VkDeviceSize stride,VkQueryResultFlags flags)1289 VkResult GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) {
1290     ALOGV("TODO: vk%s", __FUNCTION__);
1291     return VK_SUCCESS;
1292 }
1293 
DestroyBufferView(VkDevice device,VkBufferView bufferView,const VkAllocationCallbacks * allocator)1294 void DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* allocator) {
1295 }
1296 
GetImageSubresourceLayout(VkDevice device,VkImage image,const VkImageSubresource * pSubresource,VkSubresourceLayout * pLayout)1297 void GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
1298     ALOGV("TODO: vk%s", __FUNCTION__);
1299 }
1300 
DestroyImageView(VkDevice device,VkImageView imageView,const VkAllocationCallbacks * allocator)1301 void DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* allocator) {
1302 }
1303 
DestroyShaderModule(VkDevice device,VkShaderModule shaderModule,const VkAllocationCallbacks * allocator)1304 void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* allocator) {
1305 }
1306 
DestroyPipelineCache(VkDevice device,VkPipelineCache pipelineCache,const VkAllocationCallbacks * allocator)1307 void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* allocator) {
1308 }
1309 
GetPipelineCacheData(VkDevice device,VkPipelineCache pipelineCache,size_t * pDataSize,void * pData)1310 VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {
1311     ALOGV("TODO: vk%s", __FUNCTION__);
1312     return VK_SUCCESS;
1313 }
1314 
MergePipelineCaches(VkDevice device,VkPipelineCache destCache,uint32_t srcCacheCount,const VkPipelineCache * pSrcCaches)1315 VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {
1316     ALOGV("TODO: vk%s", __FUNCTION__);
1317     return VK_SUCCESS;
1318 }
1319 
DestroyPipeline(VkDevice device,VkPipeline pipeline,const VkAllocationCallbacks * allocator)1320 void DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* allocator) {
1321 }
1322 
DestroyPipelineLayout(VkDevice device,VkPipelineLayout pipelineLayout,const VkAllocationCallbacks * allocator)1323 void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* allocator) {
1324 }
1325 
DestroySampler(VkDevice device,VkSampler sampler,const VkAllocationCallbacks * allocator)1326 void DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* allocator) {
1327 }
1328 
DestroyDescriptorSetLayout(VkDevice device,VkDescriptorSetLayout descriptorSetLayout,const VkAllocationCallbacks * allocator)1329 void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* allocator) {
1330 }
1331 
DestroyDescriptorPool(VkDevice device,VkDescriptorPool descriptorPool,const VkAllocationCallbacks * allocator)1332 void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* allocator) {
1333 }
1334 
ResetDescriptorPool(VkDevice device,VkDescriptorPool descriptorPool,VkDescriptorPoolResetFlags flags)1335 VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {
1336     ALOGV("TODO: vk%s", __FUNCTION__);
1337     return VK_SUCCESS;
1338 }
1339 
UpdateDescriptorSets(VkDevice device,uint32_t writeCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t copyCount,const VkCopyDescriptorSet * pDescriptorCopies)1340 void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
1341     ALOGV("TODO: vk%s", __FUNCTION__);
1342 }
1343 
FreeDescriptorSets(VkDevice device,VkDescriptorPool descriptorPool,uint32_t count,const VkDescriptorSet * pDescriptorSets)1344 VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) {
1345     ALOGV("TODO: vk%s", __FUNCTION__);
1346     return VK_SUCCESS;
1347 }
1348 
DestroyFramebuffer(VkDevice device,VkFramebuffer framebuffer,const VkAllocationCallbacks * allocator)1349 void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* allocator) {
1350 }
1351 
DestroyRenderPass(VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * allocator)1352 void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* allocator) {
1353 }
1354 
GetRenderAreaGranularity(VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1355 void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
1356     ALOGV("TODO: vk%s", __FUNCTION__);
1357 }
1358 
ResetCommandPool(VkDevice device,VkCommandPool cmdPool,VkCommandPoolResetFlags flags)1359 VkResult ResetCommandPool(VkDevice device, VkCommandPool cmdPool, VkCommandPoolResetFlags flags) {
1360     ALOGV("TODO: vk%s", __FUNCTION__);
1361     return VK_SUCCESS;
1362 }
1363 
BeginCommandBuffer(VkCommandBuffer cmdBuffer,const VkCommandBufferBeginInfo * pBeginInfo)1364 VkResult BeginCommandBuffer(VkCommandBuffer cmdBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {
1365     return VK_SUCCESS;
1366 }
1367 
EndCommandBuffer(VkCommandBuffer cmdBuffer)1368 VkResult EndCommandBuffer(VkCommandBuffer cmdBuffer) {
1369     return VK_SUCCESS;
1370 }
1371 
ResetCommandBuffer(VkCommandBuffer cmdBuffer,VkCommandBufferResetFlags flags)1372 VkResult ResetCommandBuffer(VkCommandBuffer cmdBuffer, VkCommandBufferResetFlags flags) {
1373     ALOGV("TODO: vk%s", __FUNCTION__);
1374     return VK_SUCCESS;
1375 }
1376 
CmdBindPipeline(VkCommandBuffer cmdBuffer,VkPipelineBindPoint pipelineBindPoint,VkPipeline pipeline)1377 void CmdBindPipeline(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
1378 }
1379 
CmdSetViewport(VkCommandBuffer cmdBuffer,uint32_t firstViewport,uint32_t viewportCount,const VkViewport * pViewports)1380 void CmdSetViewport(VkCommandBuffer cmdBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) {
1381 }
1382 
CmdSetScissor(VkCommandBuffer cmdBuffer,uint32_t firstScissor,uint32_t scissorCount,const VkRect2D * pScissors)1383 void CmdSetScissor(VkCommandBuffer cmdBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) {
1384 }
1385 
CmdSetLineWidth(VkCommandBuffer cmdBuffer,float lineWidth)1386 void CmdSetLineWidth(VkCommandBuffer cmdBuffer, float lineWidth) {
1387 }
1388 
CmdSetDepthBias(VkCommandBuffer cmdBuffer,float depthBias,float depthBiasClamp,float slopeScaledDepthBias)1389 void CmdSetDepthBias(VkCommandBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
1390 }
1391 
CmdSetBlendConstants(VkCommandBuffer cmdBuffer,const float blendConst[4])1392 void CmdSetBlendConstants(VkCommandBuffer cmdBuffer, const float blendConst[4]) {
1393 }
1394 
CmdSetDepthBounds(VkCommandBuffer cmdBuffer,float minDepthBounds,float maxDepthBounds)1395 void CmdSetDepthBounds(VkCommandBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
1396 }
1397 
CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer,VkStencilFaceFlags faceMask,uint32_t stencilCompareMask)1398 void CmdSetStencilCompareMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
1399 }
1400 
CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer,VkStencilFaceFlags faceMask,uint32_t stencilWriteMask)1401 void CmdSetStencilWriteMask(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
1402 }
1403 
CmdSetStencilReference(VkCommandBuffer cmdBuffer,VkStencilFaceFlags faceMask,uint32_t stencilReference)1404 void CmdSetStencilReference(VkCommandBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
1405 }
1406 
CmdBindDescriptorSets(VkCommandBuffer cmdBuffer,VkPipelineBindPoint pipelineBindPoint,VkPipelineLayout layout,uint32_t firstSet,uint32_t setCount,const VkDescriptorSet * pDescriptorSets,uint32_t dynamicOffsetCount,const uint32_t * pDynamicOffsets)1407 void CmdBindDescriptorSets(VkCommandBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {
1408 }
1409 
CmdBindIndexBuffer(VkCommandBuffer cmdBuffer,VkBuffer buffer,VkDeviceSize offset,VkIndexType indexType)1410 void CmdBindIndexBuffer(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {
1411 }
1412 
CmdBindVertexBuffers(VkCommandBuffer cmdBuffer,uint32_t startBinding,uint32_t bindingCount,const VkBuffer * pBuffers,const VkDeviceSize * pOffsets)1413 void CmdBindVertexBuffers(VkCommandBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
1414 }
1415 
CmdDraw(VkCommandBuffer cmdBuffer,uint32_t vertexCount,uint32_t instanceCount,uint32_t firstVertex,uint32_t firstInstance)1416 void CmdDraw(VkCommandBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
1417 }
1418 
CmdDrawIndexed(VkCommandBuffer cmdBuffer,uint32_t indexCount,uint32_t instanceCount,uint32_t firstIndex,int32_t vertexOffset,uint32_t firstInstance)1419 void CmdDrawIndexed(VkCommandBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {
1420 }
1421 
CmdDrawIndirect(VkCommandBuffer cmdBuffer,VkBuffer buffer,VkDeviceSize offset,uint32_t count,uint32_t stride)1422 void CmdDrawIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
1423 }
1424 
CmdDrawIndexedIndirect(VkCommandBuffer cmdBuffer,VkBuffer buffer,VkDeviceSize offset,uint32_t count,uint32_t stride)1425 void CmdDrawIndexedIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
1426 }
1427 
CmdDispatch(VkCommandBuffer cmdBuffer,uint32_t x,uint32_t y,uint32_t z)1428 void CmdDispatch(VkCommandBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) {
1429 }
1430 
CmdDispatchIndirect(VkCommandBuffer cmdBuffer,VkBuffer buffer,VkDeviceSize offset)1431 void CmdDispatchIndirect(VkCommandBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) {
1432 }
1433 
CmdCopyBuffer(VkCommandBuffer cmdBuffer,VkBuffer srcBuffer,VkBuffer destBuffer,uint32_t regionCount,const VkBufferCopy * pRegions)1434 void CmdCopyBuffer(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {
1435 }
1436 
CmdCopyImage(VkCommandBuffer cmdBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkImage destImage,VkImageLayout destImageLayout,uint32_t regionCount,const VkImageCopy * pRegions)1437 void CmdCopyImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {
1438 }
1439 
CmdBlitImage(VkCommandBuffer cmdBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkImage destImage,VkImageLayout destImageLayout,uint32_t regionCount,const VkImageBlit * pRegions,VkFilter filter)1440 void CmdBlitImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) {
1441 }
1442 
CmdCopyBufferToImage(VkCommandBuffer cmdBuffer,VkBuffer srcBuffer,VkImage destImage,VkImageLayout destImageLayout,uint32_t regionCount,const VkBufferImageCopy * pRegions)1443 void CmdCopyBufferToImage(VkCommandBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
1444 }
1445 
CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkBuffer destBuffer,uint32_t regionCount,const VkBufferImageCopy * pRegions)1446 void CmdCopyImageToBuffer(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
1447 }
1448 
CmdUpdateBuffer(VkCommandBuffer cmdBuffer,VkBuffer destBuffer,VkDeviceSize destOffset,VkDeviceSize dataSize,const void * pData)1449 void CmdUpdateBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const void* pData) {
1450 }
1451 
CmdFillBuffer(VkCommandBuffer cmdBuffer,VkBuffer destBuffer,VkDeviceSize destOffset,VkDeviceSize fillSize,uint32_t data)1452 void CmdFillBuffer(VkCommandBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) {
1453 }
1454 
CmdClearColorImage(VkCommandBuffer cmdBuffer,VkImage image,VkImageLayout imageLayout,const VkClearColorValue * pColor,uint32_t rangeCount,const VkImageSubresourceRange * pRanges)1455 void CmdClearColorImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
1456 }
1457 
CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer,VkImage image,VkImageLayout imageLayout,const VkClearDepthStencilValue * pDepthStencil,uint32_t rangeCount,const VkImageSubresourceRange * pRanges)1458 void CmdClearDepthStencilImage(VkCommandBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
1459 }
1460 
CmdClearAttachments(VkCommandBuffer cmdBuffer,uint32_t attachmentCount,const VkClearAttachment * pAttachments,uint32_t rectCount,const VkClearRect * pRects)1461 void CmdClearAttachments(VkCommandBuffer cmdBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {
1462 }
1463 
CmdResolveImage(VkCommandBuffer cmdBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkImage destImage,VkImageLayout destImageLayout,uint32_t regionCount,const VkImageResolve * pRegions)1464 void CmdResolveImage(VkCommandBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
1465 }
1466 
CmdSetEvent(VkCommandBuffer cmdBuffer,VkEvent event,VkPipelineStageFlags stageMask)1467 void CmdSetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
1468 }
1469 
CmdResetEvent(VkCommandBuffer cmdBuffer,VkEvent event,VkPipelineStageFlags stageMask)1470 void CmdResetEvent(VkCommandBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
1471 }
1472 
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)1473 void 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) {
1474 }
1475 
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)1476 void 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) {
1477 }
1478 
CmdBeginQuery(VkCommandBuffer cmdBuffer,VkQueryPool queryPool,uint32_t slot,VkQueryControlFlags flags)1479 void CmdBeginQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) {
1480 }
1481 
CmdEndQuery(VkCommandBuffer cmdBuffer,VkQueryPool queryPool,uint32_t slot)1482 void CmdEndQuery(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) {
1483 }
1484 
CmdResetQueryPool(VkCommandBuffer cmdBuffer,VkQueryPool queryPool,uint32_t startQuery,uint32_t queryCount)1485 void CmdResetQueryPool(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) {
1486 }
1487 
CmdWriteTimestamp(VkCommandBuffer cmdBuffer,VkPipelineStageFlagBits pipelineStage,VkQueryPool queryPool,uint32_t slot)1488 void CmdWriteTimestamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) {
1489 }
1490 
CmdCopyQueryPoolResults(VkCommandBuffer cmdBuffer,VkQueryPool queryPool,uint32_t startQuery,uint32_t queryCount,VkBuffer destBuffer,VkDeviceSize destOffset,VkDeviceSize destStride,VkQueryResultFlags flags)1491 void CmdCopyQueryPoolResults(VkCommandBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags) {
1492 }
1493 
CmdPushConstants(VkCommandBuffer cmdBuffer,VkPipelineLayout layout,VkShaderStageFlags stageFlags,uint32_t start,uint32_t length,const void * values)1494 void CmdPushConstants(VkCommandBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) {
1495 }
1496 
CmdBeginRenderPass(VkCommandBuffer cmdBuffer,const VkRenderPassBeginInfo * pRenderPassBegin,VkSubpassContents contents)1497 void CmdBeginRenderPass(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {
1498 }
1499 
CmdNextSubpass(VkCommandBuffer cmdBuffer,VkSubpassContents contents)1500 void CmdNextSubpass(VkCommandBuffer cmdBuffer, VkSubpassContents contents) {
1501 }
1502 
CmdEndRenderPass(VkCommandBuffer cmdBuffer)1503 void CmdEndRenderPass(VkCommandBuffer cmdBuffer) {
1504 }
1505 
CmdExecuteCommands(VkCommandBuffer cmdBuffer,uint32_t cmdBuffersCount,const VkCommandBuffer * pCmdBuffers)1506 void CmdExecuteCommands(VkCommandBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCommandBuffer* pCmdBuffers) {
1507 }
1508 
DestroyDebugReportCallbackEXT(VkInstance instance,VkDebugReportCallbackEXT callback,const VkAllocationCallbacks * pAllocator)1509 void DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) {
1510 }
1511 
DebugReportMessageEXT(VkInstance instance,VkDebugReportFlagsEXT flags,VkDebugReportObjectTypeEXT objectType,uint64_t object,size_t location,int32_t messageCode,const char * pLayerPrefix,const char * pMessage)1512 void DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) {
1513 }
1514 
BindBufferMemory2(VkDevice device,uint32_t bindInfoCount,const VkBindBufferMemoryInfo * pBindInfos)1515 VkResult BindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) {
1516     return VK_SUCCESS;
1517 }
1518 
BindImageMemory2(VkDevice device,uint32_t bindInfoCount,const VkBindImageMemoryInfo * pBindInfos)1519 VkResult BindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) {
1520     return VK_SUCCESS;
1521 }
1522 
GetDeviceGroupPeerMemoryFeatures(VkDevice device,uint32_t heapIndex,uint32_t localDeviceIndex,uint32_t remoteDeviceIndex,VkPeerMemoryFeatureFlags * pPeerMemoryFeatures)1523 void GetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {
1524 }
1525 
CmdSetDeviceMask(VkCommandBuffer commandBuffer,uint32_t deviceMask)1526 void CmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) {
1527 }
1528 
CmdDispatchBase(VkCommandBuffer commandBuffer,uint32_t baseGroupX,uint32_t baseGroupY,uint32_t baseGroupZ,uint32_t groupCountX,uint32_t groupCountY,uint32_t groupCountZ)1529 void CmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {
1530 }
1531 
EnumeratePhysicalDeviceGroups(VkInstance instance,uint32_t * pPhysicalDeviceGroupCount,VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties)1532 VkResult EnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) {
1533     return VK_SUCCESS;
1534 }
1535 
GetImageMemoryRequirements2(VkDevice device,const VkImageMemoryRequirementsInfo2 * pInfo,VkMemoryRequirements2 * pMemoryRequirements)1536 void GetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {
1537 }
1538 
GetBufferMemoryRequirements2(VkDevice device,const VkBufferMemoryRequirementsInfo2 * pInfo,VkMemoryRequirements2 * pMemoryRequirements)1539 void GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {
1540 }
1541 
GetImageSparseMemoryRequirements2(VkDevice device,const VkImageSparseMemoryRequirementsInfo2 * pInfo,uint32_t * pSparseMemoryRequirementCount,VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements)1542 void GetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
1543 }
1544 
GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,VkPhysicalDeviceFeatures2 * pFeatures)1545 void GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) {
1546 }
1547 
GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,VkPhysicalDeviceProperties2 * pProperties)1548 void GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) {
1549 }
1550 
GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice,VkFormat format,VkFormatProperties2 * pFormatProperties)1551 void GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) {
1552 }
1553 
GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo,VkImageFormatProperties2 * pImageFormatProperties)1554 VkResult GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) {
1555     return VK_SUCCESS;
1556 }
1557 
GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice,uint32_t * pQueueFamilyPropertyCount,VkQueueFamilyProperties2 * pQueueFamilyProperties)1558 void GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) {
1559 }
1560 
GetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice,VkPhysicalDeviceMemoryProperties2 * pMemoryProperties)1561 void GetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
1562 }
1563 
GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo,uint32_t * pPropertyCount,VkSparseImageFormatProperties2 * pProperties)1564 void GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {
1565 }
1566 
TrimCommandPool(VkDevice device,VkCommandPool commandPool,VkCommandPoolTrimFlags flags)1567 void TrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) {
1568 }
1569 
GetDeviceQueue2(VkDevice device,const VkDeviceQueueInfo2 * pQueueInfo,VkQueue * pQueue)1570 void GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) {
1571 }
1572 
CreateSamplerYcbcrConversion(VkDevice device,const VkSamplerYcbcrConversionCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSamplerYcbcrConversion * pYcbcrConversion)1573 VkResult CreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {
1574     return VK_SUCCESS;
1575 }
1576 
DestroySamplerYcbcrConversion(VkDevice device,VkSamplerYcbcrConversion ycbcrConversion,const VkAllocationCallbacks * pAllocator)1577 void DestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) {
1578 }
1579 
CreateDescriptorUpdateTemplate(VkDevice device,const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate)1580 VkResult CreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
1581     return VK_SUCCESS;
1582 }
1583 
DestroyDescriptorUpdateTemplate(VkDevice device,VkDescriptorUpdateTemplate descriptorUpdateTemplate,const VkAllocationCallbacks * pAllocator)1584 void DestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {
1585 }
1586 
UpdateDescriptorSetWithTemplate(VkDevice device,VkDescriptorSet descriptorSet,VkDescriptorUpdateTemplate descriptorUpdateTemplate,const void * pData)1587 void UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {
1588 }
1589 
GetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo,VkExternalBufferProperties * pExternalBufferProperties)1590 void GetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) {
1591 }
1592 
GetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo,VkExternalFenceProperties * pExternalFenceProperties)1593 void GetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) {
1594 }
1595 
GetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo,VkExternalSemaphoreProperties * pExternalSemaphoreProperties)1596 void GetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
1597 }
1598 
GetDescriptorSetLayoutSupport(VkDevice device,const VkDescriptorSetLayoutCreateInfo * pCreateInfo,VkDescriptorSetLayoutSupport * pSupport)1599 void GetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) {
1600 }
1601 
ResetQueryPool(VkDevice device,VkQueryPool queryPool,uint32_t firstQuery,uint32_t queryCount)1602 void ResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {
1603     ALOGV("TODO: vk%s", __FUNCTION__);
1604 }
1605 
CmdBeginRenderPass2(VkCommandBuffer commandBuffer,const VkRenderPassBeginInfo * pRenderPassBegin,const VkSubpassBeginInfo * pSubpassBeginInfo)1606 void CmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) {
1607 }
1608 
CmdNextSubpass2(VkCommandBuffer commandBuffer,const VkSubpassBeginInfo * pSubpassBeginInfo,const VkSubpassEndInfo * pSubpassEndInfo)1609 void CmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) {
1610 }
1611 
CmdEndRenderPass2(VkCommandBuffer commandBuffer,const VkSubpassEndInfo * pSubpassEndInfo)1612 void CmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) {
1613 }
1614 
GetSemaphoreCounterValue(VkDevice device,VkSemaphore semaphore,uint64_t * pValue)1615 VkResult GetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) {
1616     ALOGV("TODO: vk%s", __FUNCTION__);
1617     return VK_SUCCESS;
1618 }
1619 
WaitSemaphores(VkDevice device,const VkSemaphoreWaitInfo * pWaitInfo,uint64_t timeout)1620 VkResult WaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) {
1621     ALOGV("TODO: vk%s", __FUNCTION__);
1622     return VK_SUCCESS;
1623 }
1624 
SignalSemaphore(VkDevice device,const VkSemaphoreSignalInfo * pSignalInfo)1625 VkResult SignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) {
1626     ALOGV("TODO: vk%s", __FUNCTION__);
1627     return VK_SUCCESS;
1628 }
1629 
CmdDrawIndirectCount(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)1630 void CmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {
1631 }
1632 
CmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)1633 void CmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {
1634 }
1635 
GetBufferOpaqueCaptureAddress(VkDevice device,const VkBufferDeviceAddressInfo * pInfo)1636 uint64_t GetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
1637     ALOGV("TODO: vk%s", __FUNCTION__);
1638     return 0;
1639 }
1640 
GetBufferDeviceAddress(VkDevice device,const VkBufferDeviceAddressInfo * pInfo)1641 VkDeviceAddress GetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
1642     ALOGV("TODO: vk%s", __FUNCTION__);
1643     return (VkDeviceAddress)0;
1644 }
1645 
GetDeviceMemoryOpaqueCaptureAddress(VkDevice device,const VkDeviceMemoryOpaqueCaptureAddressInfo * pInfo)1646 uint64_t GetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {
1647     ALOGV("TODO: vk%s", __FUNCTION__);
1648     return 0;
1649 }
1650 
CmdBeginRendering(VkCommandBuffer commandBuffer,const VkRenderingInfo * pRenderingInfo)1651 void CmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) {
1652 }
1653 
CmdEndRendering(VkCommandBuffer commandBuffer)1654 void CmdEndRendering(VkCommandBuffer commandBuffer) {
1655 }
1656 
CmdBindVertexBuffers2(VkCommandBuffer commandBuffer,uint32_t firstBinding,uint32_t bindingCount,const VkBuffer * pBuffers,const VkDeviceSize * pOffsets,const VkDeviceSize * pSizes,const VkDeviceSize * pStrides)1657 void CmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) {
1658 }
1659 
CmdBlitImage2(VkCommandBuffer commandBuffer,const VkBlitImageInfo2 * pBlitImageInfo)1660 void CmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo) {
1661 }
1662 
CmdCopyBuffer2(VkCommandBuffer commandBuffer,const VkCopyBufferInfo2 * pCopyBufferInfo)1663 void CmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo) {
1664 }
1665 
CmdCopyImage2(VkCommandBuffer commandBuffer,const VkCopyImageInfo2 * pCopyImageInfo)1666 void CmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo) {
1667 }
1668 
CmdCopyBufferToImage2(VkCommandBuffer commandBuffer,const VkCopyBufferToImageInfo2 * pCopyBufferToImageInfo)1669 void CmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) {
1670 }
1671 
CmdCopyImageToBuffer2(VkCommandBuffer commandBuffer,const VkCopyImageToBufferInfo2 * pCopyImageToBufferInfo)1672 void CmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) {
1673 }
1674 
CmdPipelineBarrier2(VkCommandBuffer commandBuffer,const VkDependencyInfo * pDependencyInfo)1675 void CmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo) {
1676 }
1677 
CmdResetEvent2(VkCommandBuffer commandBuffer,VkEvent event,VkPipelineStageFlags2 stageMask)1678 void CmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask) {
1679 }
1680 
CmdResolveImage2(VkCommandBuffer commandBuffer,const VkResolveImageInfo2 * pResolveImageInfo)1681 void CmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo) {
1682 }
1683 
CmdSetCullMode(VkCommandBuffer commandBuffer,VkCullModeFlags cullMode)1684 void CmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) {
1685 }
1686 
CmdSetDepthBiasEnable(VkCommandBuffer commandBuffer,VkBool32 depthBiasEnable)1687 void CmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) {
1688 }
1689 
CmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer,VkBool32 depthBoundsTestEnable)1690 void CmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) {
1691 }
1692 
CmdSetDepthCompareOp(VkCommandBuffer commandBuffer,VkCompareOp depthCompareOp)1693 void CmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) {
1694 }
1695 
CmdSetDepthTestEnable(VkCommandBuffer commandBuffer,VkBool32 depthTestEnable)1696 void CmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) {
1697 }
1698 
CmdSetDepthWriteEnable(VkCommandBuffer commandBuffer,VkBool32 depthWriteEnable)1699 void CmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) {
1700 }
1701 
CmdSetEvent2(VkCommandBuffer commandBuffer,VkEvent event,const VkDependencyInfo * pDependencyInfo)1702 void CmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo* pDependencyInfo) {
1703 }
1704 
CmdSetFrontFace(VkCommandBuffer commandBuffer,VkFrontFace frontFace)1705 void CmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace) {
1706 }
1707 
CmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer,VkBool32 primitiveRestartEnable)1708 void CmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) {
1709 }
1710 
CmdSetPrimitiveTopology(VkCommandBuffer commandBuffer,VkPrimitiveTopology primitiveTopology)1711 void CmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) {
1712 }
1713 
CmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer,VkBool32 rasterizerDiscardEnable)1714 void CmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) {
1715 }
1716 
CmdSetScissorWithCount(VkCommandBuffer commandBuffer,uint32_t scissorCount,const VkRect2D * pScissors)1717 void CmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {
1718 }
1719 
CmdSetStencilOp(VkCommandBuffer commandBuffer,VkStencilFaceFlags faceMask,VkStencilOp failOp,VkStencilOp passOp,VkStencilOp depthFailOp,VkCompareOp compareOp)1720 void CmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) {
1721 }
1722 
CmdSetStencilTestEnable(VkCommandBuffer commandBuffer,VkBool32 stencilTestEnable)1723 void CmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) {
1724 }
1725 
CmdSetViewportWithCount(VkCommandBuffer commandBuffer,uint32_t viewportCount,const VkViewport * pViewports)1726 void CmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports) {
1727 }
1728 
CmdWaitEvents2(VkCommandBuffer commandBuffer,uint32_t eventCount,const VkEvent * pEvents,const VkDependencyInfo * pDependencyInfos)1729 void CmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos) {
1730 }
1731 
CmdWriteTimestamp2(VkCommandBuffer commandBuffer,VkPipelineStageFlags2 stage,VkQueryPool queryPool,uint32_t query)1732 void CmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query) {
1733 }
1734 
CreatePrivateDataSlot(VkDevice device,const VkPrivateDataSlotCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkPrivateDataSlot * pPrivateDataSlot)1735 VkResult CreatePrivateDataSlot(VkDevice device, const VkPrivateDataSlotCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlot* pPrivateDataSlot) {
1736     ALOGV("TODO: vk%s", __FUNCTION__);
1737     return VK_SUCCESS;
1738 }
1739 
DestroyPrivateDataSlot(VkDevice device,VkPrivateDataSlot privateDataSlot,const VkAllocationCallbacks * pAllocator)1740 void DestroyPrivateDataSlot(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks* pAllocator) {
1741 }
1742 
GetDeviceBufferMemoryRequirements(VkDevice device,const VkDeviceBufferMemoryRequirements * pInfo,VkMemoryRequirements2 * pMemoryRequirements)1743 void GetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) {
1744 }
1745 
GetDeviceImageMemoryRequirements(VkDevice device,const VkDeviceImageMemoryRequirements * pInfo,VkMemoryRequirements2 * pMemoryRequirements)1746 void GetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) {
1747 }
1748 
GetDeviceImageSparseMemoryRequirements(VkDevice device,const VkDeviceImageMemoryRequirements * pInfo,uint32_t * pSparseMemoryRequirementCount,VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements)1749 void GetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
1750 }
1751 
GetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice,uint32_t * pToolCount,VkPhysicalDeviceToolProperties * pToolProperties)1752 VkResult GetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) {
1753     ALOGV("TODO: vk%s", __FUNCTION__);
1754     return VK_SUCCESS;
1755 }
1756 
GetPrivateData(VkDevice device,VkObjectType objectType,uint64_t objectHandle,VkPrivateDataSlot privateDataSlot,uint64_t * pData)1757 void GetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t* pData) {
1758 }
1759 
QueueSubmit2(VkQueue queue,uint32_t submitCount,const VkSubmitInfo2 * pSubmits,VkFence fence)1760 VkResult QueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence) {
1761     ALOGV("TODO: vk%s", __FUNCTION__);
1762     return VK_SUCCESS;
1763 }
1764 
SetPrivateData(VkDevice device,VkObjectType objectType,uint64_t objectHandle,VkPrivateDataSlot privateDataSlot,uint64_t data)1765 VkResult SetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data) {
1766     ALOGV("TODO: vk%s", __FUNCTION__);
1767     return VK_SUCCESS;
1768 }
1769 
1770 #pragma clang diagnostic pop
1771 // clang-format on
1772 
1773 }  // namespace null_driver
1774