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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33705>
This commit is contained in:
Samuel Pitoiset 2025-02-24 11:10:18 +01:00 committed by Marge Bot
parent eb1f163848
commit c58655b999

View file

@ -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;