From c58655b9993b05cc5c0358e0381fb8efb2760fa3 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 24 Feb 2025 11:10:18 +0100 Subject: [PATCH] vulkan: filter duplicate pNext struct at device creation Recently, Indiana Jones and The Great Circle messed up this by adding duplicates and this was causing the game to crash at launch. Of course, this was an application bug that VVL was also able to catch but I think maybe Mesa should ignore those instead of failing to create the logical device. Signed-off-by: Samuel Pitoiset Part-of: --- src/vulkan/util/vk_physical_device_features_gen.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vulkan/util/vk_physical_device_features_gen.py b/src/vulkan/util/vk_physical_device_features_gen.py index d1062536826..7633e98c87d 100644 --- a/src/vulkan/util/vk_physical_device_features_gen.py +++ b/src/vulkan/util/vk_physical_device_features_gen.py @@ -265,8 +265,16 @@ vk_physical_device_check_device_features(struct vk_physical_device *physical_dev if (!supported) continue; + /* Ignore duplicated structs instead of failing to create the device. */ + if (supported->sType != 0) { + vk_logw(VK_LOG_OBJS(physical_device), + "WARNING: Duplicate sType %s in the device creation chain.\\n", + vk_StructureType_to_str(features->sType)); + continue; + } + /* Check for cycles in the list */ - if (supported->pNext != NULL || supported->sType != 0) + if (supported->pNext != NULL) return VK_ERROR_UNKNOWN; supported->sType = features->sType;