Mesa (master): anv: Pull the patch version from the XML
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 4 20:15:26 UTC 2021
Module: Mesa
Branch: master
Commit: c7a045ed632deee6109e7340a1180507ea2647f5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7a045ed632deee6109e7340a1180507ea2647f5
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Sat Jan 30 10:04:00 2021 -0600
anv: Pull the patch version from the XML
For years, I've maintained that I like to bump this number manually
because it gives me a point at which to say, "I've looked at most of the
issues and I think we're up to date." The reality, however, is that I
just bump it every few months and don't really do any thorough checking.
We may as well just bump it on header updates.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Tested-by: Tapani Pälli <tapani.palli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8792>
---
src/intel/vulkan/anv_extensions.py | 3 ---
src/intel/vulkan/anv_extensions_gen.py | 19 ++++++++++++++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
index 8ddb8f98686..d1db847b4c4 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -32,8 +32,6 @@ sys.path.append(VULKAN_UTIL)
from vk_extensions import *
-API_PATCH_VERSION = 145
-
# Supported API versions. Each one is the maximum patch version for the given
# version. Version come in increasing order and each version is available if
# it's provided "enable" condition is true and all previous versions are
@@ -204,6 +202,5 @@ for i in range(len(EXTENSIONS) - 1):
MAX_API_VERSION = VkVersion('0.0.0')
for version in API_VERSIONS:
version.version = VkVersion(version.version)
- version.version.patch = API_PATCH_VERSION
assert version.version > MAX_API_VERSION
MAX_API_VERSION = version.version
diff --git a/src/intel/vulkan/anv_extensions_gen.py b/src/intel/vulkan/anv_extensions_gen.py
index 3b49c8a5f50..07a684d8388 100644
--- a/src/intel/vulkan/anv_extensions_gen.py
+++ b/src/intel/vulkan/anv_extensions_gen.py
@@ -25,7 +25,9 @@ COPYRIGHT = """\
"""
import os.path
+import re
import sys
+import xml.etree.ElementTree as et
from anv_extensions import *
@@ -34,6 +36,18 @@ sys.path.append(VULKAN_UTIL)
from vk_extensions_gen import *
+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('--out-c', help='Output C file.')
@@ -49,5 +63,8 @@ if __name__ == '__main__':
"perf/gen_perf.h"
]
- gen_extensions('anv', args.xml_files, API_VERSIONS, MAX_API_VERSION,
+ max_version = MAX_API_VERSION
+ max_version.patch = int(get_xml_patch_version(args.xml_files[0]))
+
+ gen_extensions('anv', args.xml_files, API_VERSIONS, max_version,
EXTENSIONS, args.out_c, args.out_h, includes)
More information about the mesa-commit
mailing list