blob: 59f3200a271dfaaacd1a4d33abc5c0d8dd7893c0 [file] [log] [blame]
Chia-I Wueb7db122016-03-24 09:11:06 +08001/*
2 * Copyright 2016 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// WARNING: This file is generated. See ../README.md for instructions.
18
19#include <string.h>
20#include <algorithm>
21#include <log/log.h>
22
23#include "driver.h"
Chia-I Wueb7db122016-03-24 09:11:06 +080024
25namespace vulkan {
26namespace driver {
27
28namespace {
29
30// clang-format off
31
32VKAPI_ATTR void disabledDestroySurfaceKHR(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks*) {
33 ALOGE("VK_KHR_surface not enabled. vkDestroySurfaceKHR not executed.");
34}
35
36VKAPI_ATTR VkResult disabledGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32*) {
37 ALOGE("VK_KHR_surface not enabled. vkGetPhysicalDeviceSurfaceSupportKHR not executed.");
38 return VK_SUCCESS;
39}
40
41VKAPI_ATTR VkResult disabledGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR*) {
42 ALOGE("VK_KHR_surface not enabled. vkGetPhysicalDeviceSurfaceCapabilitiesKHR not executed.");
43 return VK_SUCCESS;
44}
45
46VKAPI_ATTR VkResult disabledGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice, VkSurfaceKHR, uint32_t*, VkSurfaceFormatKHR*) {
47 ALOGE("VK_KHR_surface not enabled. vkGetPhysicalDeviceSurfaceFormatsKHR not executed.");
48 return VK_SUCCESS;
49}
50
51VKAPI_ATTR VkResult disabledGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice, VkSurfaceKHR, uint32_t*, VkPresentModeKHR*) {
52 ALOGE("VK_KHR_surface not enabled. vkGetPhysicalDeviceSurfacePresentModesKHR not executed.");
53 return VK_SUCCESS;
54}
55
56VKAPI_ATTR VkResult disabledCreateSwapchainKHR(VkDevice, const VkSwapchainCreateInfoKHR*, const VkAllocationCallbacks*, VkSwapchainKHR*) {
57 ALOGE("VK_KHR_swapchain not enabled. vkCreateSwapchainKHR not executed.");
58 return VK_SUCCESS;
59}
60
61VKAPI_ATTR VkResult checkedCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) {
Chia-I Wu62262232016-03-26 07:06:44 +080062 return (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) ? CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain) : disabledCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
Chia-I Wueb7db122016-03-24 09:11:06 +080063}
64
65VKAPI_ATTR void disabledDestroySwapchainKHR(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks*) {
66 ALOGE("VK_KHR_swapchain not enabled. vkDestroySwapchainKHR not executed.");
67}
68
69VKAPI_ATTR void checkedDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) {
Chia-I Wu62262232016-03-26 07:06:44 +080070 (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) ? DestroySwapchainKHR(device, swapchain, pAllocator) : disabledDestroySwapchainKHR(device, swapchain, pAllocator);
Chia-I Wueb7db122016-03-24 09:11:06 +080071}
72
73VKAPI_ATTR VkResult disabledGetSwapchainImagesKHR(VkDevice, VkSwapchainKHR, uint32_t*, VkImage*) {
74 ALOGE("VK_KHR_swapchain not enabled. vkGetSwapchainImagesKHR not executed.");
75 return VK_SUCCESS;
76}
77
78VKAPI_ATTR VkResult checkedGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) {
Chia-I Wu62262232016-03-26 07:06:44 +080079 return (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) ? GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages) : disabledGetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
Chia-I Wueb7db122016-03-24 09:11:06 +080080}
81
82VKAPI_ATTR VkResult disabledAcquireNextImageKHR(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t*) {
83 ALOGE("VK_KHR_swapchain not enabled. vkAcquireNextImageKHR not executed.");
84 return VK_SUCCESS;
85}
86
87VKAPI_ATTR VkResult checkedAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) {
Chia-I Wu62262232016-03-26 07:06:44 +080088 return (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) ? AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex) : disabledAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
Chia-I Wueb7db122016-03-24 09:11:06 +080089}
90
91VKAPI_ATTR VkResult disabledQueuePresentKHR(VkQueue, const VkPresentInfoKHR*) {
92 ALOGE("VK_KHR_swapchain not enabled. vkQueuePresentKHR not executed.");
93 return VK_SUCCESS;
94}
95
96VKAPI_ATTR VkResult checkedQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) {
Chia-I Wu62262232016-03-26 07:06:44 +080097 return (GetData(queue).hook_extensions[ProcHook::KHR_swapchain]) ? QueuePresentKHR(queue, pPresentInfo) : disabledQueuePresentKHR(queue, pPresentInfo);
Chia-I Wueb7db122016-03-24 09:11:06 +080098}
99
100VKAPI_ATTR VkResult disabledCreateAndroidSurfaceKHR(VkInstance, const VkAndroidSurfaceCreateInfoKHR*, const VkAllocationCallbacks*, VkSurfaceKHR*) {
101 ALOGE("VK_KHR_android_surface not enabled. vkCreateAndroidSurfaceKHR not executed.");
102 return VK_SUCCESS;
103}
104
105VKAPI_ATTR VkResult disabledCreateDebugReportCallbackEXT(VkInstance, const VkDebugReportCallbackCreateInfoEXT*, const VkAllocationCallbacks*, VkDebugReportCallbackEXT*) {
106 ALOGE("VK_EXT_debug_report not enabled. vkCreateDebugReportCallbackEXT not executed.");
107 return VK_SUCCESS;
108}
109
110VKAPI_ATTR void disabledDestroyDebugReportCallbackEXT(VkInstance, VkDebugReportCallbackEXT, const VkAllocationCallbacks*) {
111 ALOGE("VK_EXT_debug_report not enabled. vkDestroyDebugReportCallbackEXT not executed.");
112}
113
114VKAPI_ATTR void disabledDebugReportMessageEXT(VkInstance, VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char*, const char*) {
115 ALOGE("VK_EXT_debug_report not enabled. vkDebugReportMessageEXT not executed.");
116}
117
118// clang-format on
119
120const ProcHook g_proc_hooks[] = {
121 // clang-format off
122 {
123 "vkAcquireImageANDROID",
124 ProcHook::DEVICE,
125 ProcHook::ANDROID_native_buffer,
126 nullptr,
127 nullptr,
128 nullptr,
129 },
130 {
131 "vkAcquireNextImageKHR",
132 ProcHook::DEVICE,
133 ProcHook::KHR_swapchain,
Chia-I Wu62262232016-03-26 07:06:44 +0800134 reinterpret_cast<PFN_vkVoidFunction>(AcquireNextImageKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800135 reinterpret_cast<PFN_vkVoidFunction>(disabledAcquireNextImageKHR),
136 reinterpret_cast<PFN_vkVoidFunction>(checkedAcquireNextImageKHR),
137 },
138 {
139 "vkAllocateCommandBuffers",
140 ProcHook::DEVICE,
141 ProcHook::EXTENSION_CORE,
Chia-I Wu6a58a8a2016-03-24 16:29:51 +0800142 reinterpret_cast<PFN_vkVoidFunction>(AllocateCommandBuffers),
Chia-I Wueb7db122016-03-24 09:11:06 +0800143 nullptr,
144 nullptr,
145 },
146 {
147 "vkCreateAndroidSurfaceKHR",
148 ProcHook::INSTANCE,
149 ProcHook::KHR_android_surface,
Chia-I Wu62262232016-03-26 07:06:44 +0800150 reinterpret_cast<PFN_vkVoidFunction>(CreateAndroidSurfaceKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800151 reinterpret_cast<PFN_vkVoidFunction>(disabledCreateAndroidSurfaceKHR),
152 nullptr,
153 },
154 {
155 "vkCreateDebugReportCallbackEXT",
156 ProcHook::INSTANCE,
157 ProcHook::EXT_debug_report,
Chia-I Wu62262232016-03-26 07:06:44 +0800158 reinterpret_cast<PFN_vkVoidFunction>(CreateDebugReportCallbackEXT),
Chia-I Wueb7db122016-03-24 09:11:06 +0800159 reinterpret_cast<PFN_vkVoidFunction>(disabledCreateDebugReportCallbackEXT),
160 nullptr,
161 },
162 {
163 "vkCreateDevice",
164 ProcHook::INSTANCE,
165 ProcHook::EXTENSION_CORE,
Chia-I Wu4901db72016-03-24 16:38:58 +0800166 reinterpret_cast<PFN_vkVoidFunction>(CreateDevice),
Chia-I Wueb7db122016-03-24 09:11:06 +0800167 nullptr,
168 nullptr,
169 },
170 {
171 "vkCreateInstance",
172 ProcHook::GLOBAL,
173 ProcHook::EXTENSION_CORE,
Chia-I Wuff4a6c72016-03-24 16:05:56 +0800174 reinterpret_cast<PFN_vkVoidFunction>(CreateInstance),
Chia-I Wueb7db122016-03-24 09:11:06 +0800175 nullptr,
176 nullptr,
177 },
178 {
179 "vkCreateSwapchainKHR",
180 ProcHook::DEVICE,
181 ProcHook::KHR_swapchain,
Chia-I Wu62262232016-03-26 07:06:44 +0800182 reinterpret_cast<PFN_vkVoidFunction>(CreateSwapchainKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800183 reinterpret_cast<PFN_vkVoidFunction>(disabledCreateSwapchainKHR),
184 reinterpret_cast<PFN_vkVoidFunction>(checkedCreateSwapchainKHR),
185 },
186 {
187 "vkDebugReportMessageEXT",
188 ProcHook::INSTANCE,
189 ProcHook::EXT_debug_report,
Chia-I Wu62262232016-03-26 07:06:44 +0800190 reinterpret_cast<PFN_vkVoidFunction>(DebugReportMessageEXT),
Chia-I Wueb7db122016-03-24 09:11:06 +0800191 reinterpret_cast<PFN_vkVoidFunction>(disabledDebugReportMessageEXT),
192 nullptr,
193 },
194 {
195 "vkDestroyDebugReportCallbackEXT",
196 ProcHook::INSTANCE,
197 ProcHook::EXT_debug_report,
Chia-I Wu62262232016-03-26 07:06:44 +0800198 reinterpret_cast<PFN_vkVoidFunction>(DestroyDebugReportCallbackEXT),
Chia-I Wueb7db122016-03-24 09:11:06 +0800199 reinterpret_cast<PFN_vkVoidFunction>(disabledDestroyDebugReportCallbackEXT),
200 nullptr,
201 },
202 {
203 "vkDestroyDevice",
204 ProcHook::DEVICE,
205 ProcHook::EXTENSION_CORE,
Chia-I Wu4901db72016-03-24 16:38:58 +0800206 reinterpret_cast<PFN_vkVoidFunction>(DestroyDevice),
Chia-I Wueb7db122016-03-24 09:11:06 +0800207 nullptr,
208 nullptr,
209 },
210 {
211 "vkDestroyInstance",
212 ProcHook::INSTANCE,
213 ProcHook::EXTENSION_CORE,
Chia-I Wuff4a6c72016-03-24 16:05:56 +0800214 reinterpret_cast<PFN_vkVoidFunction>(DestroyInstance),
Chia-I Wueb7db122016-03-24 09:11:06 +0800215 nullptr,
216 nullptr,
217 },
218 {
219 "vkDestroySurfaceKHR",
220 ProcHook::INSTANCE,
221 ProcHook::KHR_surface,
Chia-I Wu62262232016-03-26 07:06:44 +0800222 reinterpret_cast<PFN_vkVoidFunction>(DestroySurfaceKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800223 reinterpret_cast<PFN_vkVoidFunction>(disabledDestroySurfaceKHR),
224 nullptr,
225 },
226 {
227 "vkDestroySwapchainKHR",
228 ProcHook::DEVICE,
229 ProcHook::KHR_swapchain,
Chia-I Wu62262232016-03-26 07:06:44 +0800230 reinterpret_cast<PFN_vkVoidFunction>(DestroySwapchainKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800231 reinterpret_cast<PFN_vkVoidFunction>(disabledDestroySwapchainKHR),
232 reinterpret_cast<PFN_vkVoidFunction>(checkedDestroySwapchainKHR),
233 },
234 {
235 "vkEnumerateDeviceExtensionProperties",
236 ProcHook::INSTANCE,
237 ProcHook::EXTENSION_CORE,
Chia-I Wu01cf3052016-03-24 16:16:21 +0800238 reinterpret_cast<PFN_vkVoidFunction>(EnumerateDeviceExtensionProperties),
Chia-I Wueb7db122016-03-24 09:11:06 +0800239 nullptr,
240 nullptr,
241 },
242 {
243 "vkEnumerateInstanceExtensionProperties",
244 ProcHook::GLOBAL,
245 ProcHook::EXTENSION_CORE,
246 reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceExtensionProperties),
247 nullptr,
248 nullptr,
249 },
250 {
251 "vkEnumeratePhysicalDevices",
252 ProcHook::INSTANCE,
253 ProcHook::EXTENSION_CORE,
Chia-I Wuff4a6c72016-03-24 16:05:56 +0800254 reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDevices),
Chia-I Wueb7db122016-03-24 09:11:06 +0800255 nullptr,
256 nullptr,
257 },
258 {
259 "vkGetDeviceProcAddr",
260 ProcHook::DEVICE,
261 ProcHook::EXTENSION_CORE,
262 reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr),
263 nullptr,
264 nullptr,
265 },
266 {
267 "vkGetDeviceQueue",
268 ProcHook::DEVICE,
269 ProcHook::EXTENSION_CORE,
Chia-I Wuba0be412016-03-24 16:24:40 +0800270 reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue),
Chia-I Wueb7db122016-03-24 09:11:06 +0800271 nullptr,
272 nullptr,
273 },
274 {
275 "vkGetInstanceProcAddr",
276 ProcHook::INSTANCE,
277 ProcHook::EXTENSION_CORE,
278 reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr),
279 nullptr,
280 nullptr,
281 },
282 {
283 "vkGetPhysicalDeviceSurfaceCapabilitiesKHR",
284 ProcHook::INSTANCE,
285 ProcHook::KHR_surface,
Chia-I Wu62262232016-03-26 07:06:44 +0800286 reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceCapabilitiesKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800287 reinterpret_cast<PFN_vkVoidFunction>(disabledGetPhysicalDeviceSurfaceCapabilitiesKHR),
288 nullptr,
289 },
290 {
291 "vkGetPhysicalDeviceSurfaceFormatsKHR",
292 ProcHook::INSTANCE,
293 ProcHook::KHR_surface,
Chia-I Wu62262232016-03-26 07:06:44 +0800294 reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceFormatsKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800295 reinterpret_cast<PFN_vkVoidFunction>(disabledGetPhysicalDeviceSurfaceFormatsKHR),
296 nullptr,
297 },
298 {
299 "vkGetPhysicalDeviceSurfacePresentModesKHR",
300 ProcHook::INSTANCE,
301 ProcHook::KHR_surface,
Chia-I Wu62262232016-03-26 07:06:44 +0800302 reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfacePresentModesKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800303 reinterpret_cast<PFN_vkVoidFunction>(disabledGetPhysicalDeviceSurfacePresentModesKHR),
304 nullptr,
305 },
306 {
307 "vkGetPhysicalDeviceSurfaceSupportKHR",
308 ProcHook::INSTANCE,
309 ProcHook::KHR_surface,
Chia-I Wu62262232016-03-26 07:06:44 +0800310 reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceSupportKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800311 reinterpret_cast<PFN_vkVoidFunction>(disabledGetPhysicalDeviceSurfaceSupportKHR),
312 nullptr,
313 },
314 {
315 "vkGetSwapchainGrallocUsageANDROID",
316 ProcHook::DEVICE,
317 ProcHook::ANDROID_native_buffer,
318 nullptr,
319 nullptr,
320 nullptr,
321 },
322 {
323 "vkGetSwapchainImagesKHR",
324 ProcHook::DEVICE,
325 ProcHook::KHR_swapchain,
Chia-I Wu62262232016-03-26 07:06:44 +0800326 reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainImagesKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800327 reinterpret_cast<PFN_vkVoidFunction>(disabledGetSwapchainImagesKHR),
328 reinterpret_cast<PFN_vkVoidFunction>(checkedGetSwapchainImagesKHR),
329 },
330 {
331 "vkQueuePresentKHR",
332 ProcHook::DEVICE,
333 ProcHook::KHR_swapchain,
Chia-I Wu62262232016-03-26 07:06:44 +0800334 reinterpret_cast<PFN_vkVoidFunction>(QueuePresentKHR),
Chia-I Wueb7db122016-03-24 09:11:06 +0800335 reinterpret_cast<PFN_vkVoidFunction>(disabledQueuePresentKHR),
336 reinterpret_cast<PFN_vkVoidFunction>(checkedQueuePresentKHR),
337 },
338 {
339 "vkQueueSignalReleaseImageANDROID",
340 ProcHook::DEVICE,
341 ProcHook::ANDROID_native_buffer,
342 nullptr,
343 nullptr,
344 nullptr,
345 },
346 // clang-format on
347};
348
349} // anonymous
350
351const ProcHook* GetProcHook(const char* name) {
352 const auto& begin = g_proc_hooks;
353 const auto& end =
354 g_proc_hooks + sizeof(g_proc_hooks) / sizeof(g_proc_hooks[0]);
355 const auto hook = std::lower_bound(
356 begin, end, name,
357 [](const ProcHook& e, const char* n) { return strcmp(e.name, n) < 0; });
358 return (hook < end && strcmp(hook->name, name) == 0) ? hook : nullptr;
359}
360
361ProcHook::Extension GetProcHookExtension(const char* name) {
362 // clang-format off
363 if (strcmp(name, "VK_ANDROID_native_buffer") == 0) return ProcHook::ANDROID_native_buffer;
364 if (strcmp(name, "VK_EXT_debug_report") == 0) return ProcHook::EXT_debug_report;
365 if (strcmp(name, "VK_KHR_android_surface") == 0) return ProcHook::KHR_android_surface;
366 if (strcmp(name, "VK_KHR_surface") == 0) return ProcHook::KHR_surface;
367 if (strcmp(name, "VK_KHR_swapchain") == 0) return ProcHook::KHR_swapchain;
368 // clang-format on
369 return ProcHook::EXTENSION_UNKNOWN;
370}
371
Chia-I Wucc5e2762016-03-24 13:01:16 +0800372#define UNLIKELY(expr) __builtin_expect((expr), 0)
373
374#define INIT_PROC(obj, proc) \
375 do { \
376 data.driver.proc = \
377 reinterpret_cast<PFN_vk##proc>(get_proc(obj, "vk" #proc)); \
378 if (UNLIKELY(!data.driver.proc)) { \
379 ALOGE("missing " #obj " proc: vk" #proc); \
380 success = false; \
381 } \
382 } while (0)
383
Chia-I Wucbe07ef2016-04-13 15:01:00 +0800384#define INIT_PROC_EXT(ext, obj, proc) \
385 do { \
386 if (extensions[ProcHook::ext]) \
387 INIT_PROC(obj, proc); \
Chia-I Wucc5e2762016-03-24 13:01:16 +0800388 } while (0)
389
Chia-I Wucbe07ef2016-04-13 15:01:00 +0800390bool InitDriverTable(VkInstance instance,
391 PFN_vkGetInstanceProcAddr get_proc,
392 const std::bitset<ProcHook::EXTENSION_COUNT>& extensions) {
Chia-I Wucc5e2762016-03-24 13:01:16 +0800393 auto& data = GetData(instance);
394 bool success = true;
395
396 // clang-format off
397 INIT_PROC(instance, DestroyInstance);
398 INIT_PROC(instance, EnumeratePhysicalDevices);
399 INIT_PROC(instance, GetInstanceProcAddr);
400 INIT_PROC(instance, CreateDevice);
Chia-I Wu4901db72016-03-24 16:38:58 +0800401 INIT_PROC(instance, EnumerateDeviceLayerProperties);
Chia-I Wucc5e2762016-03-24 13:01:16 +0800402 INIT_PROC(instance, EnumerateDeviceExtensionProperties);
403 INIT_PROC_EXT(EXT_debug_report, instance, CreateDebugReportCallbackEXT);
404 INIT_PROC_EXT(EXT_debug_report, instance, DestroyDebugReportCallbackEXT);
405 INIT_PROC_EXT(EXT_debug_report, instance, DebugReportMessageEXT);
406 // clang-format on
407
408 return success;
409}
410
Chia-I Wucbe07ef2016-04-13 15:01:00 +0800411bool InitDriverTable(VkDevice dev,
412 PFN_vkGetDeviceProcAddr get_proc,
413 const std::bitset<ProcHook::EXTENSION_COUNT>& extensions) {
Chia-I Wucc5e2762016-03-24 13:01:16 +0800414 auto& data = GetData(dev);
415 bool success = true;
416
417 // clang-format off
418 INIT_PROC(dev, GetDeviceProcAddr);
419 INIT_PROC(dev, DestroyDevice);
420 INIT_PROC(dev, GetDeviceQueue);
421 INIT_PROC(dev, CreateImage);
422 INIT_PROC(dev, DestroyImage);
423 INIT_PROC(dev, AllocateCommandBuffers);
424 INIT_PROC_EXT(ANDROID_native_buffer, dev, GetSwapchainGrallocUsageANDROID);
425 INIT_PROC_EXT(ANDROID_native_buffer, dev, AcquireImageANDROID);
426 INIT_PROC_EXT(ANDROID_native_buffer, dev, QueueSignalReleaseImageANDROID);
427 // clang-format on
428
429 return success;
430}
431
Chia-I Wueb7db122016-03-24 09:11:06 +0800432} // namespace driver
433} // namespace vulkan
434
435// clang-format on