From 8ca674f6aac66266e6b55fa1e2da6042799e5d5d Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Thu, 4 Dec 2025 22:42:08 +0000 Subject: [PATCH] Use safe-struct chain info copy --- source_common/framework/manual_functions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source_common/framework/manual_functions.cpp b/source_common/framework/manual_functions.cpp index cde9d3d..2f68292 100644 --- a/source_common/framework/manual_functions.cpp +++ b/source_common/framework/manual_functions.cpp @@ -784,6 +784,10 @@ VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateInstance(const VkInsta LAYER_LOG("Requested instance extension list: [%u] = %s", i, newCreateInfo->ppEnabledExtensionNames[i]); } + // Get the new chain info so we modify our safe copy, not the original + chainInfo = getChainInfo(newCreateInfo); + + // Advance the link info for the next element on the chain chainInfo->u.pLayerInfo = chainInfo->u.pLayerInfo->pNext; auto result = fpCreateInstance(newCreateInfo, pAllocator, pInstance); if (result != VK_SUCCESS) @@ -874,6 +878,9 @@ VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateDevice(VkPhysicalDevic return VK_ERROR_INITIALIZATION_FAILED; } + // Get the new chain info so we modify our safe copy, not the original + chainInfo = getChainInfo(newCreateInfo); + // Advance the link info for the next element on the chain chainInfo->u.pLayerInfo = chainInfo->u.pLayerInfo->pNext; auto res = fpCreateDevice(physicalDevice, newCreateInfo, pAllocator, pDevice);