aboutsummaryrefslogtreecommitdiffhomepage
path: root/registry/reg.py
diff options
context:
space:
mode:
authorJon Leech <[email protected]>2022-05-10 03:31:09 -0700
committerJon Leech <[email protected]>2022-05-10 03:31:39 -0700
commit33d4dd987fc8fc6475ff9ca2b4f0c3cc6e793337 (patch)
treebd675408b2a3f2618ae2b4f1e1932d3366dbaa80 /registry/reg.py
parent8ba8294c86d0e99fcb457bedbd573dd678ccc9b3 (diff)
downloadVulkan-Headers-33d4dd987fc8fc6475ff9ca2b4f0c3cc6e793337.tar.gz
Vulkan-Headers-33d4dd987fc8fc6475ff9ca2b4f0c3cc6e793337.zip
Update for Vulkan-Docs 1.3.213v1.3.213
Diffstat (limited to 'registry/reg.py')
-rw-r--r--registry/reg.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/registry/reg.py b/registry/reg.py
index 79b80c3..aac71c2 100644
--- a/registry/reg.py
+++ b/registry/reg.py
@@ -295,8 +295,10 @@ class SpirvInfo(BaseInfo):
class FormatInfo(BaseInfo):
"""Registry information about an API <format>."""
- def __init__(self, elem):
+ def __init__(self, elem, condition):
BaseInfo.__init__(self, elem)
+ # Need to save the condition here when it is known
+ self.condition = condition
class Registry:
"""Object representing an API registry, loaded from an XML file."""
@@ -400,7 +402,7 @@ class Registry:
Intended for internal use only.
- elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>` Element
- - info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv}Info object
+ - info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv|Format}Info object
- infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format'
- dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap}dict
@@ -541,6 +543,7 @@ class Registry:
# Create dictionaries of API and extension interfaces
# from toplevel <api> and <extension> tags.
self.apidict = {}
+ format_condition = dict()
for feature in self.reg.findall('feature'):
featureInfo = FeatureInfo(feature)
self.addElementInfo(feature, featureInfo, 'feature', self.apidict)
@@ -577,6 +580,11 @@ class Registry:
else:
self.gen.logMsg('warn', 'NO matching group',
groupName, 'for enum', enum.get('name'), 'found.')
+ if groupName == "VkFormat":
+ format_name = enum.get('name')
+ if enum.get('alias'):
+ format_name = enum.get('alias')
+ format_condition[format_name] = featureInfo.name
addEnumInfo = True
elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
# self.gen.logMsg('diag', 'Adding extension constant "enum"',
@@ -624,6 +632,14 @@ class Registry:
else:
self.gen.logMsg('warn', 'NO matching group',
groupName, 'for enum', enum.get('name'), 'found.')
+ if groupName == "VkFormat":
+ format_name = enum.get('name')
+ if enum.get('alias'):
+ format_name = enum.get('alias')
+ if format_name in format_condition:
+ format_condition[format_name] += "," + featureInfo.name
+ else:
+ format_condition[format_name] = featureInfo.name
addEnumInfo = True
elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
# self.gen.logMsg('diag', 'Adding extension constant "enum"',
@@ -660,7 +676,11 @@ class Registry:
self.addElementInfo(spirv, spirvInfo, 'spirvcapability', self.spirvcapdict)
for format in self.reg.findall('formats/format'):
- formatInfo = FormatInfo(format)
+ condition = None
+ format_name = format.get('name')
+ if format_name in format_condition:
+ condition = format_condition[format_name]
+ formatInfo = FormatInfo(format, condition)
self.addElementInfo(format, formatInfo, 'format', self.formatsdict)
def dumpReg(self, maxlen=120, filehandle=sys.stdout):