Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 1 | #!/usr/bin/python3 -i |
| 2 | # |
Shannon McPherson | 0b44e58 | 2019-03-05 14:06:10 -0700 | [diff] [blame] | 3 | # Copyright (c) 2015-2017, 2019 The Khronos Group Inc. |
| 4 | # Copyright (c) 2015-2017, 2019 Valve Corporation |
| 5 | # Copyright (c) 2015-2017, 2019 LunarG, Inc. |
Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # |
| 19 | # Author: Mark Lobodzinski <mark@lunarg.com> |
| 20 | |
Mike Schuchardt | 6a0ba2c | 2019-07-22 16:57:15 -0700 | [diff] [blame] | 21 | import os |
Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 22 | |
| 23 | # Copyright text prefixing all headers (list of strings). |
| 24 | prefixStrings = [ |
| 25 | '/*', |
Shannon McPherson | 0b44e58 | 2019-03-05 14:06:10 -0700 | [diff] [blame] | 26 | '** Copyright (c) 2015-2017, 2019 The Khronos Group Inc.', |
| 27 | '** Copyright (c) 2015-2017, 2019 Valve Corporation', |
| 28 | '** Copyright (c) 2015-2017, 2019 LunarG, Inc.', |
| 29 | '** Copyright (c) 2015-2017, 2019 Google Inc.', |
Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 30 | '**', |
| 31 | '** Licensed under the Apache License, Version 2.0 (the "License");', |
| 32 | '** you may not use this file except in compliance with the License.', |
| 33 | '** You may obtain a copy of the License at', |
| 34 | '**', |
| 35 | '** http://www.apache.org/licenses/LICENSE-2.0', |
| 36 | '**', |
| 37 | '** Unless required by applicable law or agreed to in writing, software', |
| 38 | '** distributed under the License is distributed on an "AS IS" BASIS,', |
| 39 | '** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.', |
| 40 | '** See the License for the specific language governing permissions and', |
| 41 | '** limitations under the License.', |
| 42 | '*/', |
| 43 | '' |
| 44 | ] |
| 45 | |
| 46 | |
| 47 | platform_dict = { |
| 48 | 'android' : 'VK_USE_PLATFORM_ANDROID_KHR', |
Shannon McPherson | 6e078e7 | 2018-10-09 16:02:22 -0600 | [diff] [blame] | 49 | 'fuchsia' : 'VK_USE_PLATFORM_FUCHSIA', |
Shannon McPherson | 2abb699 | 2019-04-05 10:46:16 -0600 | [diff] [blame] | 50 | 'ggp': 'VK_USE_PLATFORM_GGP', |
Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 51 | 'ios' : 'VK_USE_PLATFORM_IOS_MVK', |
| 52 | 'macos' : 'VK_USE_PLATFORM_MACOS_MVK', |
Shannon McPherson | f392e71 | 2019-03-06 11:25:56 -0700 | [diff] [blame] | 53 | 'metal' : 'VK_USE_PLATFORM_METAL_EXT', |
Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 54 | 'vi' : 'VK_USE_PLATFORM_VI_NN', |
| 55 | 'wayland' : 'VK_USE_PLATFORM_WAYLAND_KHR', |
| 56 | 'win32' : 'VK_USE_PLATFORM_WIN32_KHR', |
| 57 | 'xcb' : 'VK_USE_PLATFORM_XCB_KHR', |
| 58 | 'xlib' : 'VK_USE_PLATFORM_XLIB_KHR', |
Mike Schuchardt | 4c88179 | 2018-02-07 14:47:01 -0700 | [diff] [blame] | 59 | 'xlib_xrandr' : 'VK_USE_PLATFORM_XLIB_XRANDR_EXT', |
Shannon McPherson | f881e61 | 2020-03-19 13:49:18 -0600 | [diff] [blame^] | 60 | 'provisional' : 'VK_ENABLE_BETA_EXTENSIONS', |
Mark Lobodzinski | f895bcc | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | # |
| 64 | # Return appropriate feature protect string from 'platform' tag on feature |
| 65 | def GetFeatureProtect(interface): |
| 66 | """Get platform protection string""" |
| 67 | platform = interface.get('platform') |
| 68 | protect = None |
| 69 | if platform is not None: |
| 70 | protect = platform_dict[platform] |
| 71 | return protect |
Mike Schuchardt | 6a0ba2c | 2019-07-22 16:57:15 -0700 | [diff] [blame] | 72 | |
| 73 | # helper to define paths relative to the repo root |
| 74 | def repo_relative(path): |
| 75 | return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', path)) |