summaryrefslogtreecommitdiff
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2021-01-30 10:08:37 -0600
committerMarge Bot <eric+marge@anholt.net>2021-02-04 20:02:12 +0000
commit2d6de5d2274e0e2ed6b233c7cee5ec97def7a5f7 (patch)
tree88c0ba95b635915a907a0a6eed0238cd4e85e20e /src/intel
parent91931c4eddba8f3e5d7606c96ad56e2834660c1d (diff)
anv,vulkan: Move anv_icd.py to a common location
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Tested-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8792>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_icd.py78
-rw-r--r--src/intel/vulkan/meson.build2
2 files changed, 1 insertions, 79 deletions
diff --git a/src/intel/vulkan/anv_icd.py b/src/intel/vulkan/anv_icd.py
deleted file mode 100644
index d5401e80156..00000000000
--- a/src/intel/vulkan/anv_icd.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 2017 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sub license, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice (including the
-# next paragraph) shall be included in all copies or substantial portions
-# of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-# IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
-# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-import argparse
-import json
-import os.path
-import re
-import xml.etree.ElementTree as et
-
-def get_xml_patch_version(xml_file):
- xml = et.parse(xml_file)
- for d in xml.findall('.types/type'):
- if d.get('category', None) != 'define':
- continue
-
- name = d.find('.name')
- if name.text != 'VK_HEADER_VERSION':
- continue;
-
- return name.tail.strip()
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser()
- parser.add_argument('--api-version', required=True,
- help='Vulkan API version.')
- parser.add_argument('--xml', required=False,
- help='Vulkan registry XML for patch version')
- parser.add_argument('--lib-path', required=True,
- help='Path to installed library')
- parser.add_argument('--out', required=False,
- help='Output json file.')
- args = parser.parse_args()
-
- version = args.api_version
- if args.xml:
- re.match(r'\d+\.\d+', version)
- version = version + '.' + get_xml_patch_version(args.xml)
- else:
- re.match(r'\d+\.\d+\.\d+', version)
-
- json_data = {
- 'file_format_version': '1.0.0',
- 'ICD': {
- 'library_path': args.lib_path,
- 'api_version': version,
- },
- }
-
- json_params = {
- 'indent': 4,
- 'sort_keys': True,
- 'separators': (',', ': '),
- }
-
- if args.out:
- with open(args.out, 'w') as f:
- json.dump(json_data, f, **json_params)
- else:
- print(json.dumps(json_data, **json_params))
diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build
index 686438064e3..d3d72d5a15a 100644
--- a/src/intel/vulkan/meson.build
+++ b/src/intel/vulkan/meson.build
@@ -58,7 +58,7 @@ anv_extensions_h = custom_target(
intel_icd = custom_target(
'intel_icd',
- input : ['anv_icd.py', vk_api_xml],
+ input : [vk_icd_gen, vk_api_xml],
output : 'intel_icd.@0@.json'.format(host_machine.cpu()),
command : [
prog_python, '@INPUT0@',