Skip to content

Commit

Permalink
vulkan/context: fix features normalization
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kasper93 authored and haasn committed Sep 29, 2024
1 parent 83da824 commit 756220c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vulkan/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 756220c

Please sign in to comment.