Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.08k stars 513 forks source link

Uninitialized structs cause trouble for experimenting readers #217

Closed jediflamaster closed 3 years ago

jediflamaster commented 3 years ago

VkDebugUtilsMessengerCreateInfoEXT debugCreateInfo; ^ this in particular caused some trouble for me. As suggested in the tutorial I've made a function that checks whether required extensions are available. This produced trash on stack, which was then used to populate this struct. This, in turn, resulted in a segmentation fault on creating instance. Please use VkDebugUtilsMessengerCreateInfoEXT debugCreateInfo{}; I'm not sure if this is a repeating pattern because I'm still not that far into the tutorial.

Overv commented 3 years ago

debugCreateInfo is initialized by populateDebugMessengerCreateInfo if the validation layers are enabled. It shouldn't be used otherwise.