blob: 895453262dcc89fc457b5f2e6d4808df18723f50 [file] [log] [blame]
Mark Lobodzinskif895bcc2017-10-24 13:41:18 -06001#!/usr/bin/python3 -i
2#
Shannon McPherson0b44e582019-03-05 14:06:10 -07003# 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 Lobodzinskif895bcc2017-10-24 13:41:18 -06006#
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
21import os,re,sys,string
22import xml.etree.ElementTree as etree
23from generator import *
24from collections import namedtuple
Mark Lobodzinskif895bcc2017-10-24 13:41:18 -060025
26# Copyright text prefixing all headers (list of strings).
27prefixStrings = [
28 '/*',
Shannon McPherson0b44e582019-03-05 14:06:10 -070029 '** Copyright (c) 2015-2017, 2019 The Khronos Group Inc.',
30 '** Copyright (c) 2015-2017, 2019 Valve Corporation',
31 '** Copyright (c) 2015-2017, 2019 LunarG, Inc.',
32 '** Copyright (c) 2015-2017, 2019 Google Inc.',
Mark Lobodzinskif895bcc2017-10-24 13:41:18 -060033 '**',
34 '** Licensed under the Apache License, Version 2.0 (the "License");',
35 '** you may not use this file except in compliance with the License.',
36 '** You may obtain a copy of the License at',
37 '**',
38 '** http://www.apache.org/licenses/LICENSE-2.0',
39 '**',
40 '** Unless required by applicable law or agreed to in writing, software',
41 '** distributed under the License is distributed on an "AS IS" BASIS,',
42 '** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.',
43 '** See the License for the specific language governing permissions and',
44 '** limitations under the License.',
45 '*/',
46 ''
47]
48
49
50platform_dict = {
51 'android' : 'VK_USE_PLATFORM_ANDROID_KHR',
Shannon McPherson6e078e72018-10-09 16:02:22 -060052 'fuchsia' : 'VK_USE_PLATFORM_FUCHSIA',
Shannon McPherson2abb6992019-04-05 10:46:16 -060053 'ggp': 'VK_USE_PLATFORM_GGP',
Mark Lobodzinskif895bcc2017-10-24 13:41:18 -060054 'ios' : 'VK_USE_PLATFORM_IOS_MVK',
55 'macos' : 'VK_USE_PLATFORM_MACOS_MVK',
Shannon McPhersonf392e712019-03-06 11:25:56 -070056 'metal' : 'VK_USE_PLATFORM_METAL_EXT',
Mark Lobodzinskif895bcc2017-10-24 13:41:18 -060057 'vi' : 'VK_USE_PLATFORM_VI_NN',
58 'wayland' : 'VK_USE_PLATFORM_WAYLAND_KHR',
59 'win32' : 'VK_USE_PLATFORM_WIN32_KHR',
60 'xcb' : 'VK_USE_PLATFORM_XCB_KHR',
61 'xlib' : 'VK_USE_PLATFORM_XLIB_KHR',
Mike Schuchardt4c881792018-02-07 14:47:01 -070062 'xlib_xrandr' : 'VK_USE_PLATFORM_XLIB_XRANDR_EXT',
Mark Lobodzinskif895bcc2017-10-24 13:41:18 -060063}
64
65#
66# Return appropriate feature protect string from 'platform' tag on feature
67def GetFeatureProtect(interface):
68 """Get platform protection string"""
69 platform = interface.get('platform')
70 protect = None
71 if platform is not None:
72 protect = platform_dict[platform]
73 return protect