From 756220c3ee760eb62c0b89172e80f713f89fe571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 29 Sep 2024 04:48:18 +0200 Subject: [PATCH] vulkan/context: fix features normalization Connect the correct normalized feature chain to VkDeviceCreateInfo. Also, add the missing api_ver to ensure that normalization doesn't add EXT structs when they are not necessary. This fixes validation errors related to mismatches between ppEnabledExtensionNames and the feature structs in the chain. --- src/vulkan/context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vulkan/context.c b/src/vulkan/context.c index 8f4ae72a..1c70fe59 100644 --- a/src/vulkan/context.c +++ b/src/vulkan/context.c @@ -1261,7 +1261,7 @@ static bool device_init(struct vk_ctx *vk, const struct pl_vulkan_params *params // Construct normalized output chain vk->features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - vk_features_normalize(vk->alloc, &features, 0, &vk->features); + vk_features_normalize(vk->alloc, &features, vk->api_ver, &vk->features); if (!check_required_features(vk)) { PL_FATAL(vk, "Vulkan device does not support all required features!"); goto error; @@ -1285,7 +1285,7 @@ static bool device_init(struct vk_ctx *vk, const struct pl_vulkan_params *params VkDeviceCreateInfo dinfo = { .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - .pNext = &features, + .pNext = &vk->features, .pQueueCreateInfos = qinfos.elem, .queueCreateInfoCount = qinfos.num, .ppEnabledExtensionNames = vk->exts.elem,