From d451285e45957f6eade4ae586b8222e5e992bc6d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 16 Feb 2021 11:09:35 -0500 Subject: [PATCH] zink: fix device codegen extension detection the logic for this was broken and failed to detect any extensions other than the first one listed. instead, we must follow this logic chain: 1. check the extension name 2a. if this is an extension that got promoted to core, check the @since version 3a. if current version >= @since version 4a. if the extension has required features/properties, check those 4b. else set supported 3b. else 4a. if the extension has required features/properties, check those 4b. else set supported 2b. else 4a. if the extension has required features/properties, check those 4b. else set supported Fixes: efe6f00e345 ("zink/codegen: do not enable extensions that are now core") Reviewed-by: Hoe Hao Cheng Part-of: --- src/gallium/drivers/zink/zink_device_info.py | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/zink/zink_device_info.py b/src/gallium/drivers/zink/zink_device_info.py index da41d2c4539..887ed82ae39 100644 --- a/src/gallium/drivers/zink/zink_device_info.py +++ b/src/gallium/drivers/zink/zink_device_info.py @@ -263,25 +263,33 @@ zink_get_physical_device_info(struct zink_screen *screen) for (uint32_t i = 0; i < num_extensions; ++i) { %for ext in extensions: <%helpers:guard ext="${ext}"> + if (!strcmp(extensions[i].extensionName, "${ext.name}")) { %if ext.core_since: %for version in versions: %if ext.core_since.struct_version == version.struct_version: - if (${version.version()} > info->device_version) { - if (!strcmp(extensions[i].extensionName, "${ext.name}")) { + if (${version.version()} >= info->device_version) { + %if not (ext.has_features or ext.has_properties): + info->have_${ext.name_with_vendor()} = true; + %else: support_${ext.name_with_vendor()} = true; + %endif + } else { + %if not (ext.has_features or ext.has_properties): + info->have_${ext.name_with_vendor()} = true; + %else: + support_${ext.name_with_vendor()} = true; + %endif } - %if not (ext.has_features or ext.has_properties): - } else { - info->have_${ext.name_with_vendor()} = true; - %endif - } %endif %endfor %else: - if (!strcmp(extensions[i].extensionName, "${ext.name}")) { + %if not (ext.has_features or ext.has_properties): + info->have_${ext.name_with_vendor()} = true; + %else: support_${ext.name_with_vendor()} = true; - } %endif + %endif + } %endfor }