1b8e80941Smrg# Copyright 2017 Intel Corporation 2b8e80941Smrg# 3b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a 4b8e80941Smrg# copy of this software and associated documentation files (the 5b8e80941Smrg# "Software"), to deal in the Software without restriction, including 6b8e80941Smrg# without limitation the rights to use, copy, modify, merge, publish, 7b8e80941Smrg# distribute, sub license, and/or sell copies of the Software, and to 8b8e80941Smrg# permit persons to whom the Software is furnished to do so, subject to 9b8e80941Smrg# the following conditions: 10b8e80941Smrg# 11b8e80941Smrg# The above copyright notice and this permission notice (including the 12b8e80941Smrg# next paragraph) shall be included in all copies or substantial portions 13b8e80941Smrg# of the Software. 14b8e80941Smrg# 15b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16b8e80941Smrg# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17b8e80941Smrg# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 18b8e80941Smrg# IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 19b8e80941Smrg# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20b8e80941Smrg# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21b8e80941Smrg# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22b8e80941Smrg 23b8e80941Smrgimport json 24b8e80941Smrgimport os.path 25b8e80941Smrg 26b8e80941Smrgfrom tu_extensions import * 27b8e80941Smrg 28b8e80941Smrgif __name__ == '__main__': 29b8e80941Smrg parser = argparse.ArgumentParser() 30b8e80941Smrg parser.add_argument('--out', help='Output json file.', required=True) 31b8e80941Smrg parser.add_argument('--lib-path', help='Path to libvulkan_freedreno.so') 32b8e80941Smrg args = parser.parse_args() 33b8e80941Smrg 34b8e80941Smrg path = 'libvulkan_freedreno.so' 35b8e80941Smrg if args.lib_path: 36b8e80941Smrg path = os.path.join(args.lib_path, path) 37b8e80941Smrg 38b8e80941Smrg json_data = { 39b8e80941Smrg 'file_format_version': '1.0.0', 40b8e80941Smrg 'ICD': { 41b8e80941Smrg 'library_path': path, 42b8e80941Smrg 'api_version': str(MAX_API_VERSION), 43b8e80941Smrg }, 44b8e80941Smrg } 45b8e80941Smrg 46b8e80941Smrg with open(args.out, 'w') as f: 47b8e80941Smrg json.dump(json_data, f, indent = 4, sort_keys=True, separators=(',', ': ')) 48