Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions scripts/reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def has_dependency(feature, target_name, all_features_map, visited=None):
tree.remove(internal_feature)



def stripNonmatchingAPIs(tree, apiName, actuallyDelete = True):
"""Remove tree Elements with 'api' attributes matching apiName.

Expand All @@ -293,7 +294,7 @@ def stripNonmatchingAPIs(tree, apiName, actuallyDelete = True):
if apiNameMatch(apiName, api):
# Add child to the queue
stack.append(child)
elif not apiNameMatch(apiName, api):
else:
# Child does not match requested api. Remove it.
if actuallyDelete:
parent.remove(child)
Expand Down Expand Up @@ -725,16 +726,13 @@ def parseTree(self):
self.enumvaluedict = {}

# Get vendor tags
vendors = []
for tag in self.reg.findall('tags/tag'):
vendors.append(tag.get('name'))
vendors = [tag.get('name') for tag in self.reg.findall('tags/tag')]

# Function to check which (if any) vendor suffix is present on
# an API name
def getApiVendorTag(name):
for vendor in vendors:
n = len(vendor)
if name[-n:] == vendor:
if name.endswith(vendor):
return vendor
return None

Expand Down Expand Up @@ -1012,26 +1010,20 @@ def addFormatCondition(format_name, feature_name):
self.addElementInfo(spirv, spirvInfo, 'spirvcapability', self.spirvcapdict)

for format in self.reg.findall('formats/format'):
condition = None
format_name = format.get('name')
if format_name in format_condition:
condition = format_condition[format_name]
condition = format_condition.get(format_name)
formatInfo = FormatInfo(format, condition)
self.addElementInfo(format, formatInfo, 'format', self.formatsdict)

for stage in self.reg.findall('sync/syncstage'):
condition = None
stage_flag = stage.get('name')
if stage_flag in sync_pipeline_stage_condition:
condition = sync_pipeline_stage_condition[stage_flag]
condition = sync_pipeline_stage_condition.get(stage_flag)
syncInfo = SyncStageInfo(stage, condition)
self.addElementInfo(stage, syncInfo, 'syncstage', self.syncstagedict)

for access in self.reg.findall('sync/syncaccess'):
condition = None
access_flag = access.get('name')
if access_flag in sync_access_condition:
condition = sync_access_condition[access_flag]
condition = sync_access_condition.get(access_flag)
syncInfo = SyncAccessInfo(access, condition)
self.addElementInfo(access, syncInfo, 'syncaccess', self.syncaccessdict)

Expand Down