zink: reconstruct features pnext after determining extension support

for extensions that require features/properties to enable support, this
avoids adding the feature struct to the device createinfo

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11067

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28925>
(cherry picked from commit 2c180c47f7)
This commit is contained in:
Mike Blumenkrantz 2024-04-25 06:46:33 -04:00 committed by Eric Engestrom
parent 8f0d4074ad
commit b13f4897e5
2 changed files with 31 additions and 1 deletions

View file

@ -2014,7 +2014,7 @@
"description": "zink: reconstruct features pnext after determining extension support",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -654,6 +654,36 @@ zink_get_physical_device_info(struct zink_screen *screen)
info->num_extensions = num_extensions;
info->feats.pNext = NULL;
%for version in versions:
%if version.device_version < (1,2,0):
if (VK_MAKE_VERSION(1,2,0) <= screen->vk_version) {
/* VkPhysicalDeviceVulkan11Features was added in 1.2, not 1.1 as one would think */
%else:
if (${version.version()} <= screen->vk_version) {
%endif
info->feats${version.struct()}.pNext = info->feats.pNext;
info->feats.pNext = &info->feats${version.struct()};
}
%endfor
%for ext in extensions:
%if ext.has_features:
<%helpers:guard ext="${ext}">
%if ext.features_promoted:
if (info->have_${ext.name_with_vendor()} && !info->have_vulkan${ext.core_since.struct()}) {
%else:
if (info->have_${ext.name_with_vendor()}) {
%endif
info->${ext.field("feats")}.sType = ${ext.stype("FEATURES")};
info->${ext.field("feats")}.pNext = info->feats.pNext;
info->feats.pNext = &info->${ext.field("feats")};
}
</%helpers:guard>
%endif
%endfor
return true;
fail: