vulkan: Allow the same item to show up twice in core version <requires>

The way the XML is being organized these days, they're doing one
<requires> section for each promoted thing and if something gets
promoted twice by different extensions.  As long as we grab the lowest
of those core versions, we should be fine.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32433>
This commit is contained in:
Faith Ekstrand 2024-09-10 11:48:52 -05:00 committed by Marge Bot
parent 25eee91016
commit 6fe6c42903

View file

@ -104,6 +104,9 @@ class VkVersion:
return self.__int_ver() > other.__int_ver()
def __le__(self, other):
return not self.__gt__(other)
# Sort the extension list the way we expect: KHR, then EXT, then vendors
# alphabetically. For digits, read them as a whole number sort that.
# eg.: VK_KHR_8bit_storage < VK_KHR_16bit_storage < VK_EXT_acquire_xlib_display
@ -199,8 +202,10 @@ def get_all_required(xml, thing, api, beta):
version = VkVersion(feature.attrib['number'])
for t in feature.findall('./require/' + thing):
name = t.attrib['name']
assert name not in things
things[name] = Requirements(core_version=version)
if name in things:
assert things[name].core_version <= version
else:
things[name] = Requirements(core_version=version)
for extension in xml.findall('.extensions/extension'):
ext = Extension.from_xml(extension)