Mark Lobodzinski | 62f7156 | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 1 | #!/usr/bin/python3 -i |
| 2 | # |
| 3 | # Copyright (c) 2015-2017 The Khronos Group Inc. |
| 4 | # Copyright (c) 2015-2017 Valve Corporation |
| 5 | # Copyright (c) 2015-2017 LunarG, Inc. |
| 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 | |
| 21 | import os,re,sys,string |
| 22 | import xml.etree.ElementTree as etree |
| 23 | from generator import * |
| 24 | from collections import namedtuple |
| 25 | from vuid_mapping import * |
| 26 | |
| 27 | # Copyright text prefixing all headers (list of strings). |
| 28 | prefixStrings = [ |
| 29 | '/*', |
| 30 | '** Copyright (c) 2015-2017 The Khronos Group Inc.', |
| 31 | '** Copyright (c) 2015-2017 Valve Corporation', |
| 32 | '** Copyright (c) 2015-2017 LunarG, Inc.', |
| 33 | '** Copyright (c) 2015-2017 Google Inc.', |
| 34 | '**', |
| 35 | '** Licensed under the Apache License, Version 2.0 (the "License");', |
| 36 | '** you may not use this file except in compliance with the License.', |
| 37 | '** You may obtain a copy of the License at', |
| 38 | '**', |
| 39 | '** http://www.apache.org/licenses/LICENSE-2.0', |
| 40 | '**', |
| 41 | '** Unless required by applicable law or agreed to in writing, software', |
| 42 | '** distributed under the License is distributed on an "AS IS" BASIS,', |
| 43 | '** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.', |
| 44 | '** See the License for the specific language governing permissions and', |
| 45 | '** limitations under the License.', |
| 46 | '*/', |
| 47 | '' |
| 48 | ] |
| 49 | |
| 50 | |
| 51 | platform_dict = { |
| 52 | 'android' : 'VK_USE_PLATFORM_ANDROID_KHR', |
| 53 | 'ios' : 'VK_USE_PLATFORM_IOS_MVK', |
| 54 | 'macos' : 'VK_USE_PLATFORM_MACOS_MVK', |
| 55 | 'mir' : 'VK_USE_PLATFORM_MIR_KHR', |
| 56 | 'vi' : 'VK_USE_PLATFORM_VI_NN', |
| 57 | 'wayland' : 'VK_USE_PLATFORM_WAYLAND_KHR', |
| 58 | 'win32' : 'VK_USE_PLATFORM_WIN32_KHR', |
| 59 | 'xcb' : 'VK_USE_PLATFORM_XCB_KHR', |
| 60 | 'xlib' : 'VK_USE_PLATFORM_XLIB_KHR', |
Mike Schuchardt | 72b7930 | 2018-02-07 14:47:01 -0700 | [diff] [blame^] | 61 | 'xlib_xrandr' : 'VK_USE_PLATFORM_XLIB_XRANDR_EXT', |
Mark Lobodzinski | 62f7156 | 2017-10-24 13:41:18 -0600 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | # |
| 65 | # Return appropriate feature protect string from 'platform' tag on feature |
| 66 | def GetFeatureProtect(interface): |
| 67 | """Get platform protection string""" |
| 68 | platform = interface.get('platform') |
| 69 | protect = None |
| 70 | if platform is not None: |
| 71 | protect = platform_dict[platform] |
| 72 | return protect |