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: efe6f00e34 ("zink/codegen: do not enable extensions that are now core")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9081>
This commit is contained in:
Mike Blumenkrantz 2021-02-16 11:09:35 -05:00 committed by Marge Bot
parent 2491d5a662
commit d451285e45
1 changed files with 17 additions and 9 deletions

View File

@ -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
}
</%helpers:guard>
%endfor
}