From 8966029f9562d1089adb05813a23ddb5a9e9c7a6 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 30 Apr 2021 10:00:50 +0200 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/zink/zink_extensions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_extensions.py b/src/gallium/drivers/zink/zink_extensions.py index 656cfdf17b6..a9dc54439fc 100644 --- a/src/gallium/drivers/zink/zink_extensions.py +++ b/src/gallium/drivers/zink/zink_extensions.py @@ -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