Skip to content

Commit 8ca674f

Browse files
committed
Use safe-struct chain info copy
1 parent 3b9fff0 commit 8ca674f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source_common/framework/manual_functions.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateInstance<default_tag>(const VkInsta
784784
LAYER_LOG("Requested instance extension list: [%u] = %s", i, newCreateInfo->ppEnabledExtensionNames[i]);
785785
}
786786

787+
// Get the new chain info so we modify our safe copy, not the original
788+
chainInfo = getChainInfo(newCreateInfo);
789+
790+
// Advance the link info for the next element on the chain
787791
chainInfo->u.pLayerInfo = chainInfo->u.pLayerInfo->pNext;
788792
auto result = fpCreateInstance(newCreateInfo, pAllocator, pInstance);
789793
if (result != VK_SUCCESS)
@@ -874,6 +878,9 @@ VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateDevice<default_tag>(VkPhysicalDevic
874878
return VK_ERROR_INITIALIZATION_FAILED;
875879
}
876880

881+
// Get the new chain info so we modify our safe copy, not the original
882+
chainInfo = getChainInfo(newCreateInfo);
883+
877884
// Advance the link info for the next element on the chain
878885
chainInfo->u.pLayerInfo = chainInfo->u.pLayerInfo->pNext;
879886
auto res = fpCreateDevice(physicalDevice, newCreateInfo, pAllocator, pDevice);

0 commit comments

Comments
 (0)