zink/codegen: prefer first definition of prop/feature structs

Some extensions have renamed their property and/or feature structs,
listing the "correct" type first. So we should prefer that one rather
than overwriting it with a later one.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10101>
This commit is contained in:
Erik Faye-Lund 2021-04-30 10:00:50 +02:00 committed by Marge Bot
parent b59b42ec5e
commit 8966029f95
1 changed files with 4 additions and 2 deletions

View File

@ -191,9 +191,11 @@ class ExtensionRegistry:
for ty in ext.findall("require/type"):
ty_name = ty.get("name")
if self.is_features_struct(ty_name):
if (self.is_features_struct(ty_name) and
entry.features_struct is None):
entry.features_struct = ty_name
elif self.is_properties_struct(ty_name):
elif (self.is_properties_struct(ty_name) and
entry.properties_struct is None):
entry.properties_struct = ty_name
self.registry[name] = entry