Skip to content

Commit

Permalink
Fix code snippet that was not updated as part of #255
Browse files Browse the repository at this point in the history
  • Loading branch information
Overv committed Mar 8, 2022
1 parent 17dec07 commit ea275f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions en/04_Vertex_buffers/01_Vertex_buffer_creation.md
Expand Up @@ -295,16 +295,16 @@ Flushing memory ranges or using a coherent memory heap means that the driver wil
## Binding the vertex buffer

All that remains now is binding the vertex buffer during rendering operations.
We're going to extend the `createCommandBuffers` function to do that.
We're going to extend the `recordCommandBuffer` function to do that.

```c++
vkCmdBindPipeline(commandBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, graphicsPipeline);
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, graphicsPipeline);

VkBuffer vertexBuffers[] = {vertexBuffer};
VkDeviceSize offsets[] = {0};
vkCmdBindVertexBuffers(commandBuffers[i], 0, 1, vertexBuffers, offsets);
vkCmdBindVertexBuffers(commandBuffer, 0, 1, vertexBuffers, offsets);

vkCmdDraw(commandBuffers[i], static_cast<uint32_t>(vertices.size()), 1, 0, 0);
vkCmdDraw(commandBuffer, static_cast<uint32_t>(vertices.size()), 1, 0, 0);
```
The `vkCmdBindVertexBuffers` function is used to bind vertex buffers to
Expand Down

0 comments on commit ea275f6

Please sign in to comment.