1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file is auto-generated from
6 // gpu/vulkan/generate_bindings.py
7 // It's formatted by clang-format using chromium coding style:
8 //    clang-format -i -style=chromium filename
9 // DO NOT EDIT!
10 
11 #ifndef GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
12 #define GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
13 
14 #include <vulkan/vulkan.h>
15 
16 #include "base/compiler_specific.h"
17 #include "base/native_library.h"
18 #include "build/build_config.h"
19 #include "gpu/vulkan/vulkan_export.h"
20 #include "ui/gfx/extension_set.h"
21 
22 #if defined(OS_ANDROID)
23 #include <vulkan/vulkan_android.h>
24 #endif
25 
26 #if defined(OS_FUCHSIA)
27 #include <zircon/types.h>
28 // <vulkan/vulkan_fuchsia.h> must be included after <zircon/types.h>
29 #include <vulkan/vulkan_fuchsia.h>
30 
31 #include "gpu/vulkan/fuchsia/vulkan_fuchsia_ext.h"
32 #endif
33 
34 #if defined(USE_VULKAN_XLIB)
35 #include <X11/Xlib.h>
36 #include <vulkan/vulkan_xlib.h>
37 #endif
38 
39 #if defined(OS_WIN)
40 #include <vulkan/vulkan_win32.h>
41 #endif
42 
43 namespace gpu {
44 
45 struct VulkanFunctionPointers;
46 
47 VULKAN_EXPORT VulkanFunctionPointers* GetVulkanFunctionPointers();
48 
49 struct VulkanFunctionPointers {
50   VulkanFunctionPointers();
51   ~VulkanFunctionPointers();
52 
53   VULKAN_EXPORT bool BindUnassociatedFunctionPointers();
54 
55   // These functions assume that vkGetInstanceProcAddr has been populated.
56   VULKAN_EXPORT bool BindInstanceFunctionPointers(
57       VkInstance vk_instance,
58       uint32_t api_version,
59       const gfx::ExtensionSet& enabled_extensions);
60 
61   // These functions assume that vkGetDeviceProcAddr has been populated.
62   VULKAN_EXPORT bool BindDeviceFunctionPointers(
63       VkDevice vk_device,
64       uint32_t api_version,
65       const gfx::ExtensionSet& enabled_extensions);
66 
67   base::NativeLibrary vulkan_loader_library = nullptr;
68 
69   template <typename T>
70   class VulkanFunction;
71   template <typename R, typename... Args>
72   class VulkanFunction<R(VKAPI_PTR*)(Args...)> {
73    public:
74     explicit operator bool() { return !!fn_; }
75 
76     NO_SANITIZE("cfi-icall")
operatorVulkanFunctionPointers77     R operator()(Args... args) { return fn_(args...); }
78 
79    private:
80     friend VulkanFunctionPointers;
81     using Fn = R(VKAPI_PTR*)(Args...);
82 
83     Fn operator=(Fn fn) {
84       fn_ = fn;
85       return fn_;
86     }
87 
88     Fn fn_ = nullptr;
89   };
90 
91   // Unassociated functions
92   VulkanFunction<PFN_vkEnumerateInstanceVersion> vkEnumerateInstanceVersionFn;
93   VulkanFunction<PFN_vkGetInstanceProcAddr> vkGetInstanceProcAddrFn;
94 
95   VulkanFunction<PFN_vkCreateInstance> vkCreateInstanceFn;
96   VulkanFunction<PFN_vkEnumerateInstanceExtensionProperties>
97       vkEnumerateInstanceExtensionPropertiesFn;
98   VulkanFunction<PFN_vkEnumerateInstanceLayerProperties>
99       vkEnumerateInstanceLayerPropertiesFn;
100 
101   // Instance functions
102   VulkanFunction<PFN_vkCreateDevice> vkCreateDeviceFn;
103   VulkanFunction<PFN_vkDestroyInstance> vkDestroyInstanceFn;
104   VulkanFunction<PFN_vkEnumerateDeviceExtensionProperties>
105       vkEnumerateDeviceExtensionPropertiesFn;
106   VulkanFunction<PFN_vkEnumerateDeviceLayerProperties>
107       vkEnumerateDeviceLayerPropertiesFn;
108   VulkanFunction<PFN_vkEnumeratePhysicalDevices> vkEnumeratePhysicalDevicesFn;
109   VulkanFunction<PFN_vkGetDeviceProcAddr> vkGetDeviceProcAddrFn;
110   VulkanFunction<PFN_vkGetPhysicalDeviceFeatures> vkGetPhysicalDeviceFeaturesFn;
111   VulkanFunction<PFN_vkGetPhysicalDeviceFormatProperties>
112       vkGetPhysicalDeviceFormatPropertiesFn;
113   VulkanFunction<PFN_vkGetPhysicalDeviceMemoryProperties>
114       vkGetPhysicalDeviceMemoryPropertiesFn;
115   VulkanFunction<PFN_vkGetPhysicalDeviceProperties>
116       vkGetPhysicalDevicePropertiesFn;
117   VulkanFunction<PFN_vkGetPhysicalDeviceQueueFamilyProperties>
118       vkGetPhysicalDeviceQueueFamilyPropertiesFn;
119 
120 #if DCHECK_IS_ON()
121   VulkanFunction<PFN_vkCreateDebugReportCallbackEXT>
122       vkCreateDebugReportCallbackEXTFn;
123   VulkanFunction<PFN_vkDestroyDebugReportCallbackEXT>
124       vkDestroyDebugReportCallbackEXTFn;
125 #endif  // DCHECK_IS_ON()
126 
127   VulkanFunction<PFN_vkDestroySurfaceKHR> vkDestroySurfaceKHRFn;
128   VulkanFunction<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR>
129       vkGetPhysicalDeviceSurfaceCapabilitiesKHRFn;
130   VulkanFunction<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR>
131       vkGetPhysicalDeviceSurfaceFormatsKHRFn;
132   VulkanFunction<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>
133       vkGetPhysicalDeviceSurfaceSupportKHRFn;
134 
135 #if defined(USE_VULKAN_XLIB)
136   VulkanFunction<PFN_vkCreateXlibSurfaceKHR> vkCreateXlibSurfaceKHRFn;
137   VulkanFunction<PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR>
138       vkGetPhysicalDeviceXlibPresentationSupportKHRFn;
139 #endif  // defined(USE_VULKAN_XLIB)
140 
141 #if defined(OS_WIN)
142   VulkanFunction<PFN_vkCreateWin32SurfaceKHR> vkCreateWin32SurfaceKHRFn;
143   VulkanFunction<PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR>
144       vkGetPhysicalDeviceWin32PresentationSupportKHRFn;
145 #endif  // defined(OS_WIN)
146 
147 #if defined(OS_ANDROID)
148   VulkanFunction<PFN_vkCreateAndroidSurfaceKHR> vkCreateAndroidSurfaceKHRFn;
149 #endif  // defined(OS_ANDROID)
150 
151 #if defined(OS_FUCHSIA)
152   VulkanFunction<PFN_vkCreateImagePipeSurfaceFUCHSIA>
153       vkCreateImagePipeSurfaceFUCHSIAFn;
154 #endif  // defined(OS_FUCHSIA)
155 
156   VulkanFunction<PFN_vkGetPhysicalDeviceImageFormatProperties2>
157       vkGetPhysicalDeviceImageFormatProperties2Fn;
158 
159   VulkanFunction<PFN_vkGetPhysicalDeviceFeatures2>
160       vkGetPhysicalDeviceFeatures2Fn;
161 
162   // Device functions
163   VulkanFunction<PFN_vkAllocateCommandBuffers> vkAllocateCommandBuffersFn;
164   VulkanFunction<PFN_vkAllocateDescriptorSets> vkAllocateDescriptorSetsFn;
165   VulkanFunction<PFN_vkAllocateMemory> vkAllocateMemoryFn;
166   VulkanFunction<PFN_vkBeginCommandBuffer> vkBeginCommandBufferFn;
167   VulkanFunction<PFN_vkBindBufferMemory> vkBindBufferMemoryFn;
168   VulkanFunction<PFN_vkBindImageMemory> vkBindImageMemoryFn;
169   VulkanFunction<PFN_vkCmdBeginRenderPass> vkCmdBeginRenderPassFn;
170   VulkanFunction<PFN_vkCmdCopyBufferToImage> vkCmdCopyBufferToImageFn;
171   VulkanFunction<PFN_vkCmdEndRenderPass> vkCmdEndRenderPassFn;
172   VulkanFunction<PFN_vkCmdExecuteCommands> vkCmdExecuteCommandsFn;
173   VulkanFunction<PFN_vkCmdNextSubpass> vkCmdNextSubpassFn;
174   VulkanFunction<PFN_vkCmdPipelineBarrier> vkCmdPipelineBarrierFn;
175   VulkanFunction<PFN_vkCreateBuffer> vkCreateBufferFn;
176   VulkanFunction<PFN_vkCreateCommandPool> vkCreateCommandPoolFn;
177   VulkanFunction<PFN_vkCreateDescriptorPool> vkCreateDescriptorPoolFn;
178   VulkanFunction<PFN_vkCreateDescriptorSetLayout> vkCreateDescriptorSetLayoutFn;
179   VulkanFunction<PFN_vkCreateFence> vkCreateFenceFn;
180   VulkanFunction<PFN_vkCreateFramebuffer> vkCreateFramebufferFn;
181   VulkanFunction<PFN_vkCreateImage> vkCreateImageFn;
182   VulkanFunction<PFN_vkCreateImageView> vkCreateImageViewFn;
183   VulkanFunction<PFN_vkCreateRenderPass> vkCreateRenderPassFn;
184   VulkanFunction<PFN_vkCreateSampler> vkCreateSamplerFn;
185   VulkanFunction<PFN_vkCreateSemaphore> vkCreateSemaphoreFn;
186   VulkanFunction<PFN_vkCreateShaderModule> vkCreateShaderModuleFn;
187   VulkanFunction<PFN_vkDestroyBuffer> vkDestroyBufferFn;
188   VulkanFunction<PFN_vkDestroyCommandPool> vkDestroyCommandPoolFn;
189   VulkanFunction<PFN_vkDestroyDescriptorPool> vkDestroyDescriptorPoolFn;
190   VulkanFunction<PFN_vkDestroyDescriptorSetLayout>
191       vkDestroyDescriptorSetLayoutFn;
192   VulkanFunction<PFN_vkDestroyDevice> vkDestroyDeviceFn;
193   VulkanFunction<PFN_vkDestroyFence> vkDestroyFenceFn;
194   VulkanFunction<PFN_vkDestroyFramebuffer> vkDestroyFramebufferFn;
195   VulkanFunction<PFN_vkDestroyImage> vkDestroyImageFn;
196   VulkanFunction<PFN_vkDestroyImageView> vkDestroyImageViewFn;
197   VulkanFunction<PFN_vkDestroyRenderPass> vkDestroyRenderPassFn;
198   VulkanFunction<PFN_vkDestroySampler> vkDestroySamplerFn;
199   VulkanFunction<PFN_vkDestroySemaphore> vkDestroySemaphoreFn;
200   VulkanFunction<PFN_vkDestroyShaderModule> vkDestroyShaderModuleFn;
201   VulkanFunction<PFN_vkDeviceWaitIdle> vkDeviceWaitIdleFn;
202   VulkanFunction<PFN_vkEndCommandBuffer> vkEndCommandBufferFn;
203   VulkanFunction<PFN_vkFreeCommandBuffers> vkFreeCommandBuffersFn;
204   VulkanFunction<PFN_vkFreeDescriptorSets> vkFreeDescriptorSetsFn;
205   VulkanFunction<PFN_vkFreeMemory> vkFreeMemoryFn;
206   VulkanFunction<PFN_vkGetBufferMemoryRequirements>
207       vkGetBufferMemoryRequirementsFn;
208   VulkanFunction<PFN_vkGetDeviceQueue> vkGetDeviceQueueFn;
209   VulkanFunction<PFN_vkGetFenceStatus> vkGetFenceStatusFn;
210   VulkanFunction<PFN_vkGetImageMemoryRequirements>
211       vkGetImageMemoryRequirementsFn;
212   VulkanFunction<PFN_vkMapMemory> vkMapMemoryFn;
213   VulkanFunction<PFN_vkQueueSubmit> vkQueueSubmitFn;
214   VulkanFunction<PFN_vkQueueWaitIdle> vkQueueWaitIdleFn;
215   VulkanFunction<PFN_vkResetCommandBuffer> vkResetCommandBufferFn;
216   VulkanFunction<PFN_vkResetFences> vkResetFencesFn;
217   VulkanFunction<PFN_vkUnmapMemory> vkUnmapMemoryFn;
218   VulkanFunction<PFN_vkUpdateDescriptorSets> vkUpdateDescriptorSetsFn;
219   VulkanFunction<PFN_vkWaitForFences> vkWaitForFencesFn;
220 
221   VulkanFunction<PFN_vkGetDeviceQueue2> vkGetDeviceQueue2Fn;
222   VulkanFunction<PFN_vkGetImageMemoryRequirements2>
223       vkGetImageMemoryRequirements2Fn;
224 
225 #if defined(OS_ANDROID)
226   VulkanFunction<PFN_vkGetAndroidHardwareBufferPropertiesANDROID>
227       vkGetAndroidHardwareBufferPropertiesANDROIDFn;
228 #endif  // defined(OS_ANDROID)
229 
230 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
231   VulkanFunction<PFN_vkGetSemaphoreFdKHR> vkGetSemaphoreFdKHRFn;
232   VulkanFunction<PFN_vkImportSemaphoreFdKHR> vkImportSemaphoreFdKHRFn;
233 #endif  // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
234 
235 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
236   VulkanFunction<PFN_vkGetMemoryFdKHR> vkGetMemoryFdKHRFn;
237   VulkanFunction<PFN_vkGetMemoryFdPropertiesKHR> vkGetMemoryFdPropertiesKHRFn;
238 #endif  // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
239 
240 #if defined(OS_FUCHSIA)
241   VulkanFunction<PFN_vkImportSemaphoreZirconHandleFUCHSIA>
242       vkImportSemaphoreZirconHandleFUCHSIAFn;
243   VulkanFunction<PFN_vkGetSemaphoreZirconHandleFUCHSIA>
244       vkGetSemaphoreZirconHandleFUCHSIAFn;
245 #endif  // defined(OS_FUCHSIA)
246 
247 #if defined(OS_FUCHSIA)
248   VulkanFunction<PFN_vkGetMemoryZirconHandleFUCHSIA>
249       vkGetMemoryZirconHandleFUCHSIAFn;
250 #endif  // defined(OS_FUCHSIA)
251 
252 #if defined(OS_FUCHSIA)
253   VulkanFunction<PFN_vkCreateBufferCollectionFUCHSIA>
254       vkCreateBufferCollectionFUCHSIAFn;
255   VulkanFunction<PFN_vkSetBufferCollectionConstraintsFUCHSIA>
256       vkSetBufferCollectionConstraintsFUCHSIAFn;
257   VulkanFunction<PFN_vkGetBufferCollectionPropertiesFUCHSIA>
258       vkGetBufferCollectionPropertiesFUCHSIAFn;
259   VulkanFunction<PFN_vkDestroyBufferCollectionFUCHSIA>
260       vkDestroyBufferCollectionFUCHSIAFn;
261 #endif  // defined(OS_FUCHSIA)
262 
263   VulkanFunction<PFN_vkAcquireNextImageKHR> vkAcquireNextImageKHRFn;
264   VulkanFunction<PFN_vkCreateSwapchainKHR> vkCreateSwapchainKHRFn;
265   VulkanFunction<PFN_vkDestroySwapchainKHR> vkDestroySwapchainKHRFn;
266   VulkanFunction<PFN_vkGetSwapchainImagesKHR> vkGetSwapchainImagesKHRFn;
267   VulkanFunction<PFN_vkQueuePresentKHR> vkQueuePresentKHRFn;
268 };
269 
270 }  // namespace gpu
271 
272 // Unassociated functions
273 #define vkGetInstanceProcAddr \
274   gpu::GetVulkanFunctionPointers()->vkGetInstanceProcAddrFn
275 #define vkEnumerateInstanceVersion \
276   gpu::GetVulkanFunctionPointers()->vkEnumerateInstanceVersionFn
277 
278 #define vkCreateInstance gpu::GetVulkanFunctionPointers()->vkCreateInstanceFn
279 #define vkEnumerateInstanceExtensionProperties \
280   gpu::GetVulkanFunctionPointers()->vkEnumerateInstanceExtensionPropertiesFn
281 #define vkEnumerateInstanceLayerProperties \
282   gpu::GetVulkanFunctionPointers()->vkEnumerateInstanceLayerPropertiesFn
283 
284 // Instance functions
285 #define vkCreateDevice gpu::GetVulkanFunctionPointers()->vkCreateDeviceFn
286 #define vkDestroyInstance gpu::GetVulkanFunctionPointers()->vkDestroyInstanceFn
287 #define vkEnumerateDeviceExtensionProperties \
288   gpu::GetVulkanFunctionPointers()->vkEnumerateDeviceExtensionPropertiesFn
289 #define vkEnumerateDeviceLayerProperties \
290   gpu::GetVulkanFunctionPointers()->vkEnumerateDeviceLayerPropertiesFn
291 #define vkEnumeratePhysicalDevices \
292   gpu::GetVulkanFunctionPointers()->vkEnumeratePhysicalDevicesFn
293 #define vkGetDeviceProcAddr \
294   gpu::GetVulkanFunctionPointers()->vkGetDeviceProcAddrFn
295 #define vkGetPhysicalDeviceFeatures \
296   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceFeaturesFn
297 #define vkGetPhysicalDeviceFormatProperties \
298   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceFormatPropertiesFn
299 #define vkGetPhysicalDeviceMemoryProperties \
300   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceMemoryPropertiesFn
301 #define vkGetPhysicalDeviceProperties \
302   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDevicePropertiesFn
303 #define vkGetPhysicalDeviceQueueFamilyProperties \
304   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceQueueFamilyPropertiesFn
305 
306 #if DCHECK_IS_ON()
307 #define vkCreateDebugReportCallbackEXT \
308   gpu::GetVulkanFunctionPointers()->vkCreateDebugReportCallbackEXTFn
309 #define vkDestroyDebugReportCallbackEXT \
310   gpu::GetVulkanFunctionPointers()->vkDestroyDebugReportCallbackEXTFn
311 #endif  // DCHECK_IS_ON()
312 
313 #define vkDestroySurfaceKHR \
314   gpu::GetVulkanFunctionPointers()->vkDestroySurfaceKHRFn
315 #define vkGetPhysicalDeviceSurfaceCapabilitiesKHR \
316   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceSurfaceCapabilitiesKHRFn
317 #define vkGetPhysicalDeviceSurfaceFormatsKHR \
318   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceSurfaceFormatsKHRFn
319 #define vkGetPhysicalDeviceSurfaceSupportKHR \
320   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceSurfaceSupportKHRFn
321 
322 #if defined(USE_VULKAN_XLIB)
323 #define vkCreateXlibSurfaceKHR \
324   gpu::GetVulkanFunctionPointers()->vkCreateXlibSurfaceKHRFn
325 #define vkGetPhysicalDeviceXlibPresentationSupportKHR \
326   gpu::GetVulkanFunctionPointers()                    \
327       ->vkGetPhysicalDeviceXlibPresentationSupportKHRFn
328 #endif  // defined(USE_VULKAN_XLIB)
329 
330 #if defined(OS_WIN)
331 #define vkCreateWin32SurfaceKHR \
332   gpu::GetVulkanFunctionPointers()->vkCreateWin32SurfaceKHRFn
333 #define vkGetPhysicalDeviceWin32PresentationSupportKHR \
334   gpu::GetVulkanFunctionPointers()                     \
335       ->vkGetPhysicalDeviceWin32PresentationSupportKHRFn
336 #endif  // defined(OS_WIN)
337 
338 #if defined(OS_ANDROID)
339 #define vkCreateAndroidSurfaceKHR \
340   gpu::GetVulkanFunctionPointers()->vkCreateAndroidSurfaceKHRFn
341 #endif  // defined(OS_ANDROID)
342 
343 #if defined(OS_FUCHSIA)
344 #define vkCreateImagePipeSurfaceFUCHSIA \
345   gpu::GetVulkanFunctionPointers()->vkCreateImagePipeSurfaceFUCHSIAFn
346 #endif  // defined(OS_FUCHSIA)
347 
348 #define vkGetPhysicalDeviceImageFormatProperties2 \
349   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceImageFormatProperties2Fn
350 
351 #define vkGetPhysicalDeviceFeatures2 \
352   gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceFeatures2Fn
353 
354 // Device functions
355 #define vkAllocateCommandBuffers \
356   gpu::GetVulkanFunctionPointers()->vkAllocateCommandBuffersFn
357 #define vkAllocateDescriptorSets \
358   gpu::GetVulkanFunctionPointers()->vkAllocateDescriptorSetsFn
359 #define vkAllocateMemory gpu::GetVulkanFunctionPointers()->vkAllocateMemoryFn
360 #define vkBeginCommandBuffer \
361   gpu::GetVulkanFunctionPointers()->vkBeginCommandBufferFn
362 #define vkBindBufferMemory \
363   gpu::GetVulkanFunctionPointers()->vkBindBufferMemoryFn
364 #define vkBindImageMemory gpu::GetVulkanFunctionPointers()->vkBindImageMemoryFn
365 #define vkCmdBeginRenderPass \
366   gpu::GetVulkanFunctionPointers()->vkCmdBeginRenderPassFn
367 #define vkCmdCopyBufferToImage \
368   gpu::GetVulkanFunctionPointers()->vkCmdCopyBufferToImageFn
369 #define vkCmdEndRenderPass \
370   gpu::GetVulkanFunctionPointers()->vkCmdEndRenderPassFn
371 #define vkCmdExecuteCommands \
372   gpu::GetVulkanFunctionPointers()->vkCmdExecuteCommandsFn
373 #define vkCmdNextSubpass gpu::GetVulkanFunctionPointers()->vkCmdNextSubpassFn
374 #define vkCmdPipelineBarrier \
375   gpu::GetVulkanFunctionPointers()->vkCmdPipelineBarrierFn
376 #define vkCreateBuffer gpu::GetVulkanFunctionPointers()->vkCreateBufferFn
377 #define vkCreateCommandPool \
378   gpu::GetVulkanFunctionPointers()->vkCreateCommandPoolFn
379 #define vkCreateDescriptorPool \
380   gpu::GetVulkanFunctionPointers()->vkCreateDescriptorPoolFn
381 #define vkCreateDescriptorSetLayout \
382   gpu::GetVulkanFunctionPointers()->vkCreateDescriptorSetLayoutFn
383 #define vkCreateFence gpu::GetVulkanFunctionPointers()->vkCreateFenceFn
384 #define vkCreateFramebuffer \
385   gpu::GetVulkanFunctionPointers()->vkCreateFramebufferFn
386 #define vkCreateImage gpu::GetVulkanFunctionPointers()->vkCreateImageFn
387 #define vkCreateImageView gpu::GetVulkanFunctionPointers()->vkCreateImageViewFn
388 #define vkCreateRenderPass \
389   gpu::GetVulkanFunctionPointers()->vkCreateRenderPassFn
390 #define vkCreateSampler gpu::GetVulkanFunctionPointers()->vkCreateSamplerFn
391 #define vkCreateSemaphore gpu::GetVulkanFunctionPointers()->vkCreateSemaphoreFn
392 #define vkCreateShaderModule \
393   gpu::GetVulkanFunctionPointers()->vkCreateShaderModuleFn
394 #define vkDestroyBuffer gpu::GetVulkanFunctionPointers()->vkDestroyBufferFn
395 #define vkDestroyCommandPool \
396   gpu::GetVulkanFunctionPointers()->vkDestroyCommandPoolFn
397 #define vkDestroyDescriptorPool \
398   gpu::GetVulkanFunctionPointers()->vkDestroyDescriptorPoolFn
399 #define vkDestroyDescriptorSetLayout \
400   gpu::GetVulkanFunctionPointers()->vkDestroyDescriptorSetLayoutFn
401 #define vkDestroyDevice gpu::GetVulkanFunctionPointers()->vkDestroyDeviceFn
402 #define vkDestroyFence gpu::GetVulkanFunctionPointers()->vkDestroyFenceFn
403 #define vkDestroyFramebuffer \
404   gpu::GetVulkanFunctionPointers()->vkDestroyFramebufferFn
405 #define vkDestroyImage gpu::GetVulkanFunctionPointers()->vkDestroyImageFn
406 #define vkDestroyImageView \
407   gpu::GetVulkanFunctionPointers()->vkDestroyImageViewFn
408 #define vkDestroyRenderPass \
409   gpu::GetVulkanFunctionPointers()->vkDestroyRenderPassFn
410 #define vkDestroySampler gpu::GetVulkanFunctionPointers()->vkDestroySamplerFn
411 #define vkDestroySemaphore \
412   gpu::GetVulkanFunctionPointers()->vkDestroySemaphoreFn
413 #define vkDestroyShaderModule \
414   gpu::GetVulkanFunctionPointers()->vkDestroyShaderModuleFn
415 #define vkDeviceWaitIdle gpu::GetVulkanFunctionPointers()->vkDeviceWaitIdleFn
416 #define vkEndCommandBuffer \
417   gpu::GetVulkanFunctionPointers()->vkEndCommandBufferFn
418 #define vkFreeCommandBuffers \
419   gpu::GetVulkanFunctionPointers()->vkFreeCommandBuffersFn
420 #define vkFreeDescriptorSets \
421   gpu::GetVulkanFunctionPointers()->vkFreeDescriptorSetsFn
422 #define vkFreeMemory gpu::GetVulkanFunctionPointers()->vkFreeMemoryFn
423 #define vkGetBufferMemoryRequirements \
424   gpu::GetVulkanFunctionPointers()->vkGetBufferMemoryRequirementsFn
425 #define vkGetDeviceQueue gpu::GetVulkanFunctionPointers()->vkGetDeviceQueueFn
426 #define vkGetFenceStatus gpu::GetVulkanFunctionPointers()->vkGetFenceStatusFn
427 #define vkGetImageMemoryRequirements \
428   gpu::GetVulkanFunctionPointers()->vkGetImageMemoryRequirementsFn
429 #define vkMapMemory gpu::GetVulkanFunctionPointers()->vkMapMemoryFn
430 #define vkQueueSubmit gpu::GetVulkanFunctionPointers()->vkQueueSubmitFn
431 #define vkQueueWaitIdle gpu::GetVulkanFunctionPointers()->vkQueueWaitIdleFn
432 #define vkResetCommandBuffer \
433   gpu::GetVulkanFunctionPointers()->vkResetCommandBufferFn
434 #define vkResetFences gpu::GetVulkanFunctionPointers()->vkResetFencesFn
435 #define vkUnmapMemory gpu::GetVulkanFunctionPointers()->vkUnmapMemoryFn
436 #define vkUpdateDescriptorSets \
437   gpu::GetVulkanFunctionPointers()->vkUpdateDescriptorSetsFn
438 #define vkWaitForFences gpu::GetVulkanFunctionPointers()->vkWaitForFencesFn
439 
440 #define vkGetDeviceQueue2 gpu::GetVulkanFunctionPointers()->vkGetDeviceQueue2Fn
441 #define vkGetImageMemoryRequirements2 \
442   gpu::GetVulkanFunctionPointers()->vkGetImageMemoryRequirements2Fn
443 
444 #if defined(OS_ANDROID)
445 #define vkGetAndroidHardwareBufferPropertiesANDROID \
446   gpu::GetVulkanFunctionPointers()                  \
447       ->vkGetAndroidHardwareBufferPropertiesANDROIDFn
448 #endif  // defined(OS_ANDROID)
449 
450 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
451 #define vkGetSemaphoreFdKHR \
452   gpu::GetVulkanFunctionPointers()->vkGetSemaphoreFdKHRFn
453 #define vkImportSemaphoreFdKHR \
454   gpu::GetVulkanFunctionPointers()->vkImportSemaphoreFdKHRFn
455 #endif  // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
456 
457 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
458 #define vkGetMemoryFdKHR gpu::GetVulkanFunctionPointers()->vkGetMemoryFdKHRFn
459 #define vkGetMemoryFdPropertiesKHR \
460   gpu::GetVulkanFunctionPointers()->vkGetMemoryFdPropertiesKHRFn
461 #endif  // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
462 
463 #if defined(OS_FUCHSIA)
464 #define vkImportSemaphoreZirconHandleFUCHSIA \
465   gpu::GetVulkanFunctionPointers()->vkImportSemaphoreZirconHandleFUCHSIAFn
466 #define vkGetSemaphoreZirconHandleFUCHSIA \
467   gpu::GetVulkanFunctionPointers()->vkGetSemaphoreZirconHandleFUCHSIAFn
468 #endif  // defined(OS_FUCHSIA)
469 
470 #if defined(OS_FUCHSIA)
471 #define vkGetMemoryZirconHandleFUCHSIA \
472   gpu::GetVulkanFunctionPointers()->vkGetMemoryZirconHandleFUCHSIAFn
473 #endif  // defined(OS_FUCHSIA)
474 
475 #if defined(OS_FUCHSIA)
476 #define vkCreateBufferCollectionFUCHSIA \
477   gpu::GetVulkanFunctionPointers()->vkCreateBufferCollectionFUCHSIAFn
478 #define vkSetBufferCollectionConstraintsFUCHSIA \
479   gpu::GetVulkanFunctionPointers()->vkSetBufferCollectionConstraintsFUCHSIAFn
480 #define vkGetBufferCollectionPropertiesFUCHSIA \
481   gpu::GetVulkanFunctionPointers()->vkGetBufferCollectionPropertiesFUCHSIAFn
482 #define vkDestroyBufferCollectionFUCHSIA \
483   gpu::GetVulkanFunctionPointers()->vkDestroyBufferCollectionFUCHSIAFn
484 #endif  // defined(OS_FUCHSIA)
485 
486 #define vkAcquireNextImageKHR \
487   gpu::GetVulkanFunctionPointers()->vkAcquireNextImageKHRFn
488 #define vkCreateSwapchainKHR \
489   gpu::GetVulkanFunctionPointers()->vkCreateSwapchainKHRFn
490 #define vkDestroySwapchainKHR \
491   gpu::GetVulkanFunctionPointers()->vkDestroySwapchainKHRFn
492 #define vkGetSwapchainImagesKHR \
493   gpu::GetVulkanFunctionPointers()->vkGetSwapchainImagesKHRFn
494 #define vkQueuePresentKHR gpu::GetVulkanFunctionPointers()->vkQueuePresentKHRFn
495 
496 #endif  // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
497