2
即使Vulkan的創建失敗,我是否應該銷燬一個實例?即使Vulkan的創建失敗,我是否應該銷燬一個實例?
哪一個是正確的:
1:
VkResult Result = vkCreateInstance(info, NULL, instance);
if(Result != VK_SUCCESS)
{
vkDestroyInstance(Instance, NULL);
glfwTerminate();
exit(EXIT_FAILURE);
}
2:
VkResult Result = vkCreateInstance(info, NULL, instance);
if(Result != VK_SUCCESS)
{
glfwTerminate();
exit(EXIT_FAILURE);
}