diff options
author | Jon Leech <[email protected]> | 2020-05-15 04:54:44 -0700 |
---|---|---|
committer | Jon Leech <[email protected]> | 2020-05-15 04:55:11 -0700 |
commit | 09531f27933bf04bffde9074acb302e026e8f181 (patch) | |
tree | 689fa3dec1ce6b5651a21fc2f49596672b5b4f31 /registry/reg.py | |
parent | 9250d5ae8f50202005233dc0512a1d460c8b4833 (diff) | |
download | Vulkan-Headers-09531f27933bf04bffde9074acb302e026e8f181.tar.gz Vulkan-Headers-09531f27933bf04bffde9074acb302e026e8f181.zip |
Update for Vulkan-Docs 1.2.141v1.2.141sdk-1.2.141.0sdk-1.2.141
Diffstat (limited to 'registry/reg.py')
-rwxr-xr-x | registry/reg.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/registry/reg.py b/registry/reg.py index 9c5cbc0..d0bd065 100755 --- a/registry/reg.py +++ b/registry/reg.py @@ -23,6 +23,16 @@ from collections import defaultdict, namedtuple from generator import OutputGenerator, GeneratorOptions, write +def apiNameMatch(str, supported): + """Return whether a required api name matches a pattern specified for an + XML <feature> 'api' attribute or <extension> 'supported' attribute. + + - str - api name such as 'vulkan' or 'openxr' + - supported - comma-separated list of XML API names""" + + return (str is not None and str in supported.split(',')) + + def matchAPIProfile(api, profile, elem): """Return whether an API and profile being generated matches an element's profile @@ -1154,7 +1164,7 @@ class Registry: for key in self.apidict: fi = self.apidict[key] api = fi.elem.get('api') - if api == self.genOpts.apiname: + if apiNameMatch(self.genOpts.apiname, api): apiMatch = True if regVersions.match(fi.name): # Matches API & version #s being generated. Mark for @@ -1191,13 +1201,10 @@ class Registry: extName = ei.name include = False - # Include extension if defaultExtensions is not None and if the - # 'supported' attribute matches defaultExtensions. The regexp in - # 'supported' must exactly match defaultExtensions, so bracket - # it with ^(pat)$. - pat = '^(' + ei.elem.get('supported') + ')$' - if (self.genOpts.defaultExtensions - and re.match(pat, self.genOpts.defaultExtensions)): + # Include extension if defaultExtensions is not None and is + # exactly matched by the 'supported' attribute. + if apiNameMatch(self.genOpts.defaultExtensions, + ei.elem.get('supported')): self.gen.logMsg('diag', 'Including extension', extName, "(defaultExtensions matches the 'supported' attribute)") include = True |