Overv / VulkanTutorial

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

Typo in Index buffer Section #288

Closed zixin96 closed 2 years ago

zixin96 commented 2 years ago

Hello, I've found some inconsistencies between the text and the source code in the index buffer section.

  1. Using an index buffer for drawing involves two changes to createCommandBuffers. 

    In the source code, we made changes to recordCommandBuffer instead of createCommandBuffers.

  2. The text shows

    vkCmdBindVertexBuffers(commandBuffers[i], 0, 1, vertexBuffers, offsets);
    vkCmdBindIndexBuffer(commandBuffers[i], indexBuffer, 0, VK_INDEX_TYPE_UINT16);
    vkCmdDrawIndexed(commandBuffers[i], static_cast<uint32_t>(indices.size()), 1, 0, 0, 0);

    , but the source code shows:

    vkCmdBindVertexBuffers(commandBuffer, 0, 1, vertexBuffers, offsets);
    vkCmdBindIndexBuffer(commandBuffer, indexBuffer, 0, VK_INDEX_TYPE_UINT16);
    vkCmdDrawIndexed(commandBuffer, static_cast<uint32_t>(indices.size()), 1, 0, 0, 0);

Thanks, Zixin

Overv commented 2 years ago

Thanks for reporting. I've fixed this and a bunch of other inconsistencies.