On the page,
https://vulkan-tutorial.com/Uniform_buffers/Descriptor_layout_and_buffer
it says to use updateUniformBuffer(imageIndex); in the drawFrame() function.
It should be updateUniformBuffer(currentFrame);
Using imageIndex results in a crash because the imageIndex is set by the number of swapchain images, which is not always equal to MAX_FRAMES_IN_FLIGHT.
The sample code correctly uses currentFrame, but the website is different.
On the page, https://vulkan-tutorial.com/Uniform_buffers/Descriptor_layout_and_buffer it says to use updateUniformBuffer(imageIndex); in the drawFrame() function. It should be updateUniformBuffer(currentFrame); Using imageIndex results in a crash because the imageIndex is set by the number of swapchain images, which is not always equal to MAX_FRAMES_IN_FLIGHT. The sample code correctly uses currentFrame, but the website is different.