• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef VK_FN_INFO_H
16 #define VK_FN_INFO_H
17 
18 #include <vulkan/vulkan.h>
19 
20 #include <initializer_list>
21 #include <tuple>
22 
23 namespace vk_util {
24 namespace vk_fn_info {
25 template <class T>
26 struct GetVkFnInfo;
27 
28 #define REGISTER_VK_FN_INFO(coreName, allNames)                 \
29     struct coreName;                                            \
30     template <>                                                 \
31     struct GetVkFnInfo<coreName> {                              \
32         static constexpr auto names = std::make_tuple allNames; \
33         using type = PFN_vk##coreName;                          \
34     };
35 
36 REGISTER_VK_FN_INFO(GetPhysicalDeviceProperties2,
37                     ("vkGetPhysicalDeviceProperties2KHR", "vkGetPhysicalDeviceProperties2"))
38 REGISTER_VK_FN_INFO(GetPhysicalDeviceImageFormatProperties2,
39                     ("vkGetPhysicalDeviceImageFormatProperties2KHR",
40                      "vkGetPhysicalDeviceImageFormatProperties2"))
41 REGISTER_VK_FN_INFO(GetPhysicalDeviceFeatures2,
42                     ("vkGetPhysicalDeviceFeatures2", "vkGetPhysicalDeviceFeatures2KHR"));
43 }  // namespace vk_fn_info
44 }  // namespace vk_util
45 
46 #endif /* VK_FN_INFO_H */
47