Overv / VulkanTutorial

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

updateUniformBuffer has incorrect parameter and is inconsistent with the sample code #290

Closed bobby3605 closed 2 years ago

bobby3605 commented 2 years ago

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.

Overv commented 2 years ago

This has been fixed in cbf32cc2909decb3a94857345c9377b1c2ffb45b after it was also reported in a comment.