blob: 0a0338ed711ecb550011df331a9fd595ef49f6c8 [file] [log] [blame]
Jesse Hall1f91d392015-12-11 16:28:44 -08001{{/*
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 "../api/templates/vulkan_common.tmpl"}}
18{{Global "clang-format" (Strings "clang-format" "-style=file")}}
19{{Macro "DefineGlobals" $}}
20{{$ | Macro "dispatch_gen.h" | Format (Global "clang-format") | Write "dispatch_gen.h" }}
21{{$ | Macro "dispatch_gen.cpp" | Format (Global "clang-format") | Write "dispatch_gen.cpp"}}
22
23{{/*
24-------------------------------------------------------------------------------
25 dispatch_gen.h
26-------------------------------------------------------------------------------
27*/}}
28{{define "dispatch_gen.h"}}
29/*
30•* Copyright 2015 The Android Open Source Project
31•*
32•* Licensed under the Apache License, Version 2.0 (the "License");
33•* you may not use this file except in compliance with the License.
34•* You may obtain a copy of the License at
35•*
36•* http://www.apache.org/licenses/LICENSE-2.0
37•*
38•* Unless required by applicable law or agreed to in writing, software
39•* distributed under the License is distributed on an "AS IS" BASIS,
40•* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41•* See the License for the specific language governing permissions and
42•* limitations under the License.
43•*/
44
Jesse Hall0a402092016-02-01 14:43:47 -080045// WARNING: This file is generated. See ../README.md for instructions.
46
Jesse Hall1f91d392015-12-11 16:28:44 -080047#define VK_USE_PLATFORM_ANDROID_KHR
48#include <vulkan/vk_android_native_buffer.h>
49#include <vulkan/vulkan.h>
50
51namespace vulkan {
52
53struct InstanceDispatchTable
54 // clang-format off
55 {{range $f := AllCommands $}}
56 {{if (Macro "IsInstanceDispatched" $f)}}
57 {{Macro "FunctionPtrName" $f}} {{Macro "BaseName" $f}};
58 {{end}}
59 {{end}}
60 // clang-format on
61»};
62
63struct DeviceDispatchTable
64 // clang-format off
65 {{range $f := AllCommands $}}
66 {{if (Macro "IsDeviceDispatched" $f)}}
67 {{Macro "FunctionPtrName" $f}} {{Macro "BaseName" $f}};
68 {{end}}
69 {{end}}
70 // clang-format on
71»};
72
73struct DriverDispatchTable
74 // clang-format off
75 {{range $f := AllCommands $}}
76 {{if (Macro "IsInstanceDispatched" $f)}}
77 {{if not (Macro "IsLoaderFunction" $f)}}
78 {{Macro "FunctionPtrName" $f}} {{Macro "BaseName" $f}};
79 {{end}}
80 {{end}}
81 {{end}}
82
83 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
84
85 {{/* TODO(jessehall): Needed by swapchain code. Figure out a better way of
86 handling this that avoids the special case. Probably should rework
87 things so the driver dispatch table has all driver functions. Probably
88 need separate instance- and device-level copies, fill in all device-
89 dispatched functions in the device-level copies only, and change
90 GetDeviceProcAddr_Bottom to look in the already-loaded driver
91 dispatch table rather than forwarding to the driver's
92 vkGetDeviceProcAddr. */}}
93 PFN_vkCreateImage CreateImage;
94 PFN_vkDestroyImage DestroyImage;
95
96 PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID;
97 PFN_vkAcquireImageANDROID AcquireImageANDROID;
98 PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID;
99 // clang-format on
100»};
101
102} // namespace vulkan
103¶{{end}}
104
105
106{{/*
107-------------------------------------------------------------------------------
108 dispatch_gen.cpp
109-------------------------------------------------------------------------------
110*/}}
111{{define "dispatch_gen.cpp"}}
112/*
113•* Copyright 2015 The Android Open Source Project
114•*
115•* Licensed under the Apache License, Version 2.0 (the "License");
116•* you may not use this file except in compliance with the License.
117•* You may obtain a copy of the License at
118•*
119•* http://www.apache.org/licenses/LICENSE-2.0
120•*
121•* Unless required by applicable law or agreed to in writing, software
122•* distributed under the License is distributed on an "AS IS" BASIS,
123•* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
124•* See the License for the specific language governing permissions and
125•* limitations under the License.
126•*/
127
Jesse Hall0a402092016-02-01 14:43:47 -0800128// WARNING: This file is generated. See ../README.md for instructions.
129
Jesse Hall1f91d392015-12-11 16:28:44 -0800130#include <log/log.h>
131#include <algorithm>
132#include "loader.h"
133
134#define UNLIKELY(expr) __builtin_expect((expr), 0)
135
136using namespace vulkan;
137
138namespace {
139
140struct NameProc {
141 const char* name;
142 PFN_vkVoidFunction proc;
143};
144
145PFN_vkVoidFunction Lookup(const char* name, const NameProc* begin, const NameProc* end) {
146 const auto& entry = std::lower_bound(
147 begin, end, name,
148 [](const NameProc& e, const char* n) { return strcmp(e.name, n) < 0; });
149 if (entry == end || strcmp(entry->name, name) != 0)
150 return nullptr;
151 return entry->proc;
152}
153
154template <size_t N>
155PFN_vkVoidFunction Lookup(const char* name, const NameProc (&procs)[N]) {
156 return Lookup(name, procs, procs + N);
157}
158
159const NameProc kLoaderExportProcs[] =
160 // clang-format off
161 {{range $f := SortBy (AllCommands $) "FunctionName"}}
Jesse Hall715b86a2016-01-16 16:34:29 -0800162 {{if (Macro "IsExported" $f)}}
Jesse Hall1f91d392015-12-11 16:28:44 -0800163 {"{{$f.Name}}", reinterpret_cast<PFN_vkVoidFunction>({{$f.Name}})},
164 {{end}}
165 {{end}}
166 // clang-format on
167»};
168
169const NameProc kLoaderGlobalProcs[] =
170 // clang-format off
171 {{range $f := SortBy (AllCommands $) "FunctionName"}}
172 {{if and (Macro "HasLoaderTopImpl" $f) (eq (Macro "Vtbl" $f) "Global")}}
173 {"{{$f.Name}}", reinterpret_cast<PFN_vkVoidFunction>(§
174 static_cast<{{Macro "FunctionPtrName" $f}}>(§
175 {{Macro "BaseName" $f}}_Top))},
176 {{end}}
177 {{end}}
178 // clang-format on
179»};
180
181const NameProc kLoaderTopProcs[] =
182 // clang-format off
183 {{range $f := SortBy (AllCommands $) "FunctionName"}}
184 {{if (Macro "HasLoaderTopImpl" $f)}}
185 {"{{$f.Name}}", reinterpret_cast<PFN_vkVoidFunction>(§
186 static_cast<{{Macro "FunctionPtrName" $f}}>(§
187 {{Macro "BaseName" $f}}_Top))},
188 {{end}}
189 {{end}}
190 // clang-format on
191»};
192
193const NameProc kLoaderBottomProcs[] =
194 // clang-format off
195 {{range $f := SortBy (AllCommands $) "FunctionName"}}
196 {{if (Macro "HasLoaderBottomImpl" $f)}}
197 {"{{$f.Name}}", reinterpret_cast<PFN_vkVoidFunction>(§
198 static_cast<{{Macro "FunctionPtrName" $f}}>(§
199 {{Macro "BaseName" $f}}_Bottom))},
200 {{end}}
201 {{end}}
202 // clang-format on
203»};
204
205struct NameOffset {
206 const char* name;
207 size_t offset;
208};
209
210ssize_t Lookup(const char* name,
211 const NameOffset* begin,
212 const NameOffset* end) {
213 const auto& entry = std::lower_bound(
214 begin, end, name, [](const NameOffset& e, const char* n) {
215 return strcmp(e.name, n) < 0;
216 });
217 if (entry == end || strcmp(entry->name, name) != 0)
218 return -1;
219 return static_cast<ssize_t>(entry->offset);
220}
221
222template <size_t N, class Table>
223PFN_vkVoidFunction Lookup(const char* name,
224 const NameOffset (&offsets)[N],
225 const Table& table) {
226 ssize_t offset = Lookup(name, offsets, offsets + N);
227 if (offset < 0)
228 return nullptr;
229 uintptr_t base = reinterpret_cast<uintptr_t>(&table);
230 return *reinterpret_cast<PFN_vkVoidFunction*>(base +
231 static_cast<size_t>(offset));
232}
233
234const NameOffset kInstanceDispatchOffsets[] =
235 // clang-format off
236 {{range $f := SortBy (AllCommands $) "FunctionName"}}
237 {{if (Macro "IsInstanceDispatched" $f)}}
238 {"{{$f.Name}}", offsetof(InstanceDispatchTable, {{Macro "BaseName" $f}})},
239 {{end}}
240 {{end}}
241 // clang-format on
242»};
243
244const NameOffset kDeviceDispatchOffsets[] =
245 // clang-format off
246 {{range $f := SortBy (AllCommands $) "FunctionName"}}
247 {{if (Macro "IsDeviceDispatched" $f)}}
248 {"{{$f.Name}}", offsetof(DeviceDispatchTable, {{Macro "BaseName" $f}})},
249 {{end}}
250 {{end}}
251 // clang-format on
252»};
253
254} // anonymous namespace
255
256namespace vulkan {
257
258PFN_vkVoidFunction GetLoaderExportProcAddr(const char* name) {
259 return Lookup(name, kLoaderExportProcs);
260}
261
262PFN_vkVoidFunction GetLoaderGlobalProcAddr(const char* name) {
263 return Lookup(name, kLoaderGlobalProcs);
264}
265
266PFN_vkVoidFunction GetLoaderTopProcAddr(const char* name) {
267 return Lookup(name, kLoaderTopProcs);
268}
269
270PFN_vkVoidFunction GetLoaderBottomProcAddr(const char* name) {
271 return Lookup(name, kLoaderBottomProcs);
272}
273
274PFN_vkVoidFunction GetDispatchProcAddr(const InstanceDispatchTable& dispatch,
275 const char* name) {
276 return Lookup(name, kInstanceDispatchOffsets, dispatch);
277}
278
279PFN_vkVoidFunction GetDispatchProcAddr(const DeviceDispatchTable& dispatch,
280 const char* name) {
281 return Lookup(name, kDeviceDispatchOffsets, dispatch);
282}
283
284bool LoadInstanceDispatchTable(VkInstance instance,
285 PFN_vkGetInstanceProcAddr get_proc_addr,
286 InstanceDispatchTable& dispatch)
287 bool success = true;
288 // clang-format off
289 {{range $f := AllCommands $}}
290 {{if (Macro "IsInstanceDispatched" $f)}}
291 dispatch.{{Macro "BaseName" $f}} = §
292 reinterpret_cast<{{Macro "FunctionPtrName" $f}}>(§
293 get_proc_addr(instance, "{{$f.Name}}"));
294 if (UNLIKELY(!dispatch.{{Macro "BaseName" $f}})) {
295 ALOGE("missing instance proc: %s", "{{$f.Name}}");
296 success = false;
297 }
298 {{end}}
299 {{end}}
300 // clang-format on
301 return success;
302»}
303
304bool LoadDeviceDispatchTable(VkDevice device,
305 PFN_vkGetDeviceProcAddr get_proc_addr,
306 DeviceDispatchTable& dispatch)
307 bool success = true;
308 // clang-format off
309 {{range $f := AllCommands $}}
310 {{if (Macro "IsDeviceDispatched" $f)}}
311 dispatch.{{Macro "BaseName" $f}} = §
312 reinterpret_cast<{{Macro "FunctionPtrName" $f}}>(§
313 get_proc_addr(device, "{{$f.Name}}"));
314 if (UNLIKELY(!dispatch.{{Macro "BaseName" $f}})) {
315 ALOGE("missing device proc: %s", "{{$f.Name}}");
316 success = false;
317 }
318 {{end}}
319 {{end}}
320 // clang-format on
321 return success;
322»}
323
324bool LoadDriverDispatchTable(VkInstance instance,
325 PFN_vkGetInstanceProcAddr get_proc_addr,
Jesse Hall6bd5dfa2016-01-16 17:13:30 -0800326 const InstanceExtensionSet& extensions,
Jesse Hall1f91d392015-12-11 16:28:44 -0800327 DriverDispatchTable& dispatch)
328 bool success = true;
329 // clang-format off
330 {{range $f := AllCommands $}}
331 {{if (Macro "IsInstanceDispatched" $f)}}
332 {{if not (Macro "IsLoaderFunction" $f)}}
Jesse Hall6bd5dfa2016-01-16 17:13:30 -0800333 {{$ext := GetAnnotation $f "extension"}}
334 {{if $ext}}
335 if (extensions[{{Macro "ExtensionConstant" $ext}}]) {
336 {{end}}
337 dispatch.{{Macro "BaseName" $f}} = §
338 reinterpret_cast<{{Macro "FunctionPtrName" $f}}>(§
339 get_proc_addr(instance, "{{$f.Name}}"));
340 if (UNLIKELY(!dispatch.{{Macro "BaseName" $f}})) {
341 ALOGE("missing driver proc: %s", "{{$f.Name}}");
342 success = false;
343 }
344 {{if $ext}}
Jesse Hall1f91d392015-12-11 16:28:44 -0800345 }
Jesse Hall6bd5dfa2016-01-16 17:13:30 -0800346 {{end}}
Jesse Hall1f91d392015-12-11 16:28:44 -0800347 {{end}}
348 {{end}}
349 {{end}}
350 dispatch.GetDeviceProcAddr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(get_proc_addr(instance, "vkGetDeviceProcAddr"));
351 if (UNLIKELY(!dispatch.GetDeviceProcAddr)) {
352 ALOGE("missing driver proc: %s", "vkGetDeviceProcAddr");
353 success = false;
354 }
355 dispatch.CreateImage = reinterpret_cast<PFN_vkCreateImage>(get_proc_addr(instance, "vkCreateImage"));
356 if (UNLIKELY(!dispatch.CreateImage)) {
357 ALOGE("missing driver proc: %s", "vkCreateImage");
358 success = false;
359 }
360 dispatch.DestroyImage = reinterpret_cast<PFN_vkDestroyImage>(get_proc_addr(instance, "vkDestroyImage"));
361 if (UNLIKELY(!dispatch.DestroyImage)) {
362 ALOGE("missing driver proc: %s", "vkDestroyImage");
363 success = false;
364 }
Jesse Halld9132822016-01-14 15:50:52 -0800365 dispatch.GetSwapchainGrallocUsageANDROID = reinterpret_cast<PFN_vkGetSwapchainGrallocUsageANDROID>(get_proc_addr(instance, "vkGetSwapchainGrallocUsageANDROID"));
366 if (UNLIKELY(!dispatch.GetSwapchainGrallocUsageANDROID)) {
367 ALOGE("missing driver proc: %s", "vkGetSwapchainGrallocUsageANDROID");
368 success = false;
369 }
Jesse Hall1f91d392015-12-11 16:28:44 -0800370 dispatch.AcquireImageANDROID = reinterpret_cast<PFN_vkAcquireImageANDROID>(get_proc_addr(instance, "vkAcquireImageANDROID"));
371 if (UNLIKELY(!dispatch.AcquireImageANDROID)) {
372 ALOGE("missing driver proc: %s", "vkAcquireImageANDROID");
373 success = false;
374 }
375 dispatch.QueueSignalReleaseImageANDROID = reinterpret_cast<PFN_vkQueueSignalReleaseImageANDROID>(get_proc_addr(instance, "vkQueueSignalReleaseImageANDROID"));
376 if (UNLIKELY(!dispatch.QueueSignalReleaseImageANDROID)) {
377 ALOGE("missing driver proc: %s", "vkQueueSignalReleaseImageANDROID");
378 success = false;
379 }
380 // clang-format on
381 return success;
382»}
383
384} // namespace vulkan
385
386// clang-format off
387
388{{range $f := AllCommands $}}
389 {{if and (not (GetAnnotation $f "pfn")) (Macro "IsExported" $f)}}
390 __attribute__((visibility("default")))
391 VKAPI_ATTR {{Node "Type" $f.Return}} {{$f.Name}}({{Macro "Parameters" $f}}) {
392 {{if not (IsVoid $f.Return.Type)}}return §{{end}}
393 {{Macro "Dispatch" $f}}({{Macro "Arguments" $f}});
394 }
395
396 {{end}}
397{{end}}
398
399// clang-format on
400¶{{end}}
401
402
403{{/*
404-------------------------------------------------------------------------------
405 Emit the dispatch lookup for a function based on its first parameter.
406-------------------------------------------------------------------------------
407*/}}
408{{define "Dispatch"}}
409 {{AssertType $ "Function"}}
410
411 {{if (Macro "HasLoaderTopImpl" $)}}
412 {{Macro "BaseName" $}}_Top§
413 {{else}}
414 {{$p0 := index $.CallParameters 0}}
415 GetDispatchTable({{$p0.Name}}).{{Macro "BaseName" $}}§
416 {{end}}
417{{end}}
418
419
420{{/*
421-------------------------------------------------------------------------------
Jesse Hall6bd5dfa2016-01-16 17:13:30 -0800422 Map an extension name to InstanceExtension or DeviceExtension enum value
423-------------------------------------------------------------------------------
424*/}}
425{{define "ExtensionConstant"}}
426 {{$name := index $.Arguments 0}}
427 {{ if (eq $name "VK_KHR_surface")}}kKHR_surface
428 {{else if (eq $name "VK_KHR_android_surface")}}kKHR_android_surface
429 {{else if (eq $name "VK_EXT_debug_report")}}kEXT_debug_report
430 {{end}}
431{{end}}
432
433
434{{/*
435-------------------------------------------------------------------------------
Jesse Hall1f91d392015-12-11 16:28:44 -0800436 Emits a function name without the "vk" prefix.
437-------------------------------------------------------------------------------
438*/}}
439{{define "BaseName"}}
440 {{AssertType $ "Function"}}
441 {{TrimPrefix "vk" $.Name}}
442{{end}}
443
444
445{{/*
446-------------------------------------------------------------------------------
447 Emits a comma-separated list of C parameter names for the given command.
448-------------------------------------------------------------------------------
449*/}}
450{{define "Arguments"}}
451 {{AssertType $ "Function"}}
452
453 {{ForEach $.CallParameters "ParameterName" | JoinWith ", "}}
454{{end}}
455
456
457{{/*
458------------------------------------------------------------------------------
459 Emit "true" for supported functions that undergo table dispatch. Only global
460 functions and functions handled in the loader top without calling into
461 lower layers are not dispatched.
462------------------------------------------------------------------------------
463*/}}
464{{define "IsInstanceDispatched"}}
465 {{AssertType $ "Function"}}
466 {{if and (Macro "IsFunctionSupported" $) (eq (Macro "Vtbl" $) "Instance")}}
Courtney Goeltzenleuchter1cc0d372016-02-05 17:10:59 -0700467 {{if and (ne $.Name "vkEnumerateDeviceLayerProperties") (ne $.Name "vkGetInstanceProcAddr")}}true{{end}}
Jesse Hall1f91d392015-12-11 16:28:44 -0800468 {{end}}
469{{end}}
470
471
472{{/*
473------------------------------------------------------------------------------
474 Emit "true" for supported functions that can have device-specific dispatch.
475------------------------------------------------------------------------------
476*/}}
477{{define "IsDeviceDispatched"}}
478 {{AssertType $ "Function"}}
479 {{if (Macro "IsFunctionSupported" $)}}
480 {{if eq (Macro "Vtbl" $) "Device"}}
481 {{if ne $.Name "vkGetDeviceProcAddr"}}
482 true
483 {{end}}
484 {{end}}
485 {{end}}
486{{end}}
487
488
489{{/*
490------------------------------------------------------------------------------
491 Emit "true" if a function is core or from a supportable extension.
492------------------------------------------------------------------------------
493*/}}
494{{define "IsFunctionSupported"}}
495 {{AssertType $ "Function"}}
496 {{if not (GetAnnotation $ "pfn")}}
497 {{$ext := GetAnnotation $ "extension"}}
498 {{if not $ext}}true
499 {{else if not (Macro "IsExtensionBlacklisted" $ext)}}true
500 {{end}}
501 {{end}}
502{{end}}
503
504
505{{/*
506------------------------------------------------------------------------------
507 Decides whether a function should be exported from the Android Vulkan
508 library. Functions in the core API and in loader extensions are exported.
509------------------------------------------------------------------------------
510*/}}
511{{define "IsExported"}}
512 {{AssertType $ "Function"}}
513
Jesse Hall715b86a2016-01-16 16:34:29 -0800514 {{if (Macro "IsFunctionSupported" $)}}
515 {{$ext := GetAnnotation $ "extension"}}
516 {{if $ext}}
517 {{Macro "IsLoaderExtension" $ext}}
518 {{else}}
519 true
520 {{end}}
Jesse Hall1f91d392015-12-11 16:28:44 -0800521 {{end}}
522{{end}}
523
524
525{{/*
526------------------------------------------------------------------------------
527 Reports whether an extension function is implemented entirely by the loader,
528 and not implemented by drivers.
529------------------------------------------------------------------------------
530*/}}
531{{define "IsLoaderFunction"}}
532 {{AssertType $ "Function"}}
533
534 {{$ext := GetAnnotation $ "extension"}}
535 {{if $ext}}
536 {{Macro "IsLoaderExtension" $ext}}
537 {{end}}
538{{end}}
539
540
541{{/*
542-------------------------------------------------------------------------------
543 Emit "true" if the loader has a top-level implementation for the function
544 that should be called directly rather than dispatching to the first layer.
545-------------------------------------------------------------------------------
546*/}}
547{{define "HasLoaderTopImpl"}}
548 {{AssertType $ "Function"}}
549
550 {{/* Global functions can't be dispatched */}}
551 {{ if and (not (GetAnnotation $ "pfn")) (eq (Macro "Vtbl" $) "Global")}}true
552
553 {{/* G*PA are implemented by reading the dispatch table, not by dispatching
554 through it. */}}
555 {{else if eq $.Name "vkGetInstanceProcAddr"}}true
556 {{else if eq $.Name "vkGetDeviceProcAddr"}}true
557
558 {{/* Loader top needs to initialize dispatch for device-level dispatchable
559 objects */}}
560 {{else if eq $.Name "vkGetDeviceQueue"}}true
561 {{else if eq $.Name "vkAllocateCommandBuffers"}}true
Courtney Goeltzenleuchtera90ce612016-02-08 20:48:05 -0700562 {{else if eq $.Name "vkCreateDevice"}}true
Courtney Goeltzenleuchter1cc0d372016-02-05 17:10:59 -0700563 {{else if eq $.Name "vkEnumerateDeviceLayerProperties"}}true
Courtney Goeltzenleuchter26d394b2016-02-07 10:32:27 -0700564 {{else if eq $.Name "vkEnumerateDeviceExtensionProperties"}}true
Jesse Hall1f91d392015-12-11 16:28:44 -0800565
566 {{/* vkDestroy for dispatchable objects needs to handle VK_NULL_HANDLE;
567 trying to dispatch through that would crash. */}}
568 {{else if eq $.Name "vkDestroyInstance"}}true
569 {{else if eq $.Name "vkDestroyDevice"}}true
570
571 {{end}}
572{{end}}
573
574
575{{/*
576-------------------------------------------------------------------------------
577 Emit "true" if the loader has a bottom-level implementation for the function
578 which terminates the dispatch chain.
579-------------------------------------------------------------------------------
580*/}}
581{{define "HasLoaderBottomImpl"}}
582 {{AssertType $ "Function"}}
583
584 {{if (Macro "IsFunctionSupported" $)}}
585 {{ if (eq (Macro "Vtbl" $) "Instance")}}true
586 {{else if (Macro "IsLoaderFunction" $)}}true
587 {{else if (eq $.Name "vkCreateInstance")}}true
588 {{else if (eq $.Name "vkGetDeviceProcAddr")}}true
589 {{end}}
590 {{end}}
591{{end}}
592
593
594{{/*
595------------------------------------------------------------------------------
596 Emit "true" if an extension is unsupportable on Android.
597------------------------------------------------------------------------------
598*/}}
599{{define "IsExtensionBlacklisted"}}
600 {{$ext := index $.Arguments 0}}
601 {{ if eq $ext "VK_KHR_display"}}true
602 {{else if eq $ext "VK_KHR_display_swapchain"}}true
603 {{else if eq $ext "VK_KHR_xlib_surface"}}true
604 {{else if eq $ext "VK_KHR_xcb_surface"}}true
605 {{else if eq $ext "VK_KHR_wayland_surface"}}true
606 {{else if eq $ext "VK_KHR_mir_surface"}}true
607 {{else if eq $ext "VK_KHR_win32_surface"}}true
608 {{end}}
609{{end}}
610
611
612{{/*
613------------------------------------------------------------------------------
614 Reports whether an extension is implemented entirely by the loader,
615 so drivers should not enumerate it.
616------------------------------------------------------------------------------
617*/}}
618{{define "IsLoaderExtension"}}
619 {{$ext := index $.Arguments 0}}
620 {{ if eq $ext "VK_KHR_surface"}}true
621 {{else if eq $ext "VK_KHR_swapchain"}}true
622 {{else if eq $ext "VK_KHR_android_surface"}}true
623 {{end}}
624{{end}}