MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / createInverseMap

Method createInverseMap

scripts/scriptgenerator.py:393–417  ·  view source on GitHub ↗

This creates the inverse mapping of nonexistent APIs in this build to their aliases which are supported. Must be called by language-specific subclasses before emitting that mapping.

(self)

Source from the content-addressed store, hash-verified

391 self.addMapping(name, param_type)
392
393 def createInverseMap(self):
394 """This creates the inverse mapping of nonexistent APIs in this
395 build to their aliases which are supported. Must be called by
396 language-specific subclasses before emitting that mapping."""
397
398 # Map from APIs not supported in this build to aliases that are.
399 # When there are multiple valid choices for remapping, choose the
400 # most-official suffixed one (KHR > EXT > vendor).
401 for key in self.alias:
402 # If the API key is aliased to something which does not exist,
403 # then add the thing that does not exist to the nonexistent map.
404 # This is used in spec macros to make promoted extension links
405 # in specs built without the promoted interface refer to the
406 # older interface instead.
407
408 invkey = self.alias[key]
409
410 if invkey not in self.typeCategory:
411 if invkey in self.nonexistent:
412 # Potentially remap existing mapping to a more official
413 # alias.
414 self.nonexistent[invkey] = mostOfficial(self.nonexistent[invkey], key)
415 else:
416 # Create remapping to an alias
417 self.nonexistent[invkey] = key

Callers 3

endFileMethod · 0.80
endFileMethod · 0.80
endFileMethod · 0.80

Calls 1

mostOfficialFunction · 0.85

Tested by

no test coverage detected