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 gfxstream {
24 namespace vk {
25 namespace vk_util {
26 namespace vk_fn_info {
27 template <class T>
28 struct GetVkFnInfo;
29 
30 #define REGISTER_VK_FN_INFO(coreName, allNames)                 \
31     struct coreName;                                            \
32     template <>                                                 \
33     struct GetVkFnInfo<coreName> {                              \
34         static constexpr auto names = std::make_tuple allNames; \
35         using type = PFN_vk##coreName;                          \
36     };
37 
38 REGISTER_VK_FN_INFO(GetPhysicalDeviceProperties2,
39                     ("vkGetPhysicalDeviceProperties2KHR", "vkGetPhysicalDeviceProperties2"))
40 REGISTER_VK_FN_INFO(GetPhysicalDeviceImageFormatProperties2,
41                     ("vkGetPhysicalDeviceImageFormatProperties2KHR",
42                      "vkGetPhysicalDeviceImageFormatProperties2"))
43 REGISTER_VK_FN_INFO(GetPhysicalDeviceFeatures2,
44                     ("vkGetPhysicalDeviceFeatures2", "vkGetPhysicalDeviceFeatures2KHR"));
45 
46 }  // namespace vk_fn_info
47 }  // namespace vk_util
48 }  // namespace vk
49 }  // namespace gfxstream
50 
51 #endif /* VK_FN_INFO_H */
52