@@ -68,7 +68,7 @@ void initVulkan() {
6868 ...
6969 createVertexBuffer();
7070 createIndexBuffer();
71- ...
71+ ...
7272}
7373
7474void createIndexBuffer() {
@@ -126,12 +126,13 @@ vkCmdDrawIndexed(commandBuffers[i], indices.size(), 1, 0, 0, 0);
126126```
127127
128128A call to this function is very similar to ` vkCmdDraw ` . The first two parameters
129- specify the number of indices and the number of vertices. The number of indices
130- represents the number of vertices that will be passed to the vertex buffer. The
131- next parameter specifies an offset into the index buffer, using a value of ` 1 `
132- would cause the graphics card to start reading at the second index. The second
133- to last parameter specifies an offset to add to the indices in the index buffer.
134- The final parameter specifies an offset for instancing, which we're not using.
129+ specify the number of indices and the number of instances. We're not using
130+ instancing, so just specify ` 1 ` instance. The number of indices represents the
131+ number of vertices that will be passed to the vertex buffer. The next parameter
132+ specifies an offset into the index buffer, using a value of ` 1 ` would cause the
133+ graphics card to start reading at the second index. The second to last parameter
134+ specifies an offset to add to the indices in the index buffer. The final
135+ parameter specifies an offset for instancing, which we're not using.
135136
136137Now run your program and you should see the following:
137138
@@ -153,4 +154,4 @@ provided that their data is refreshed, of course. This is known as *aliasing*
153154and some Vulkan functions have explicit flags to specify that you want to do
154155this.
155156
156- [ Full code listing] ( /code/index_buffer.cpp )
157+ [ Full code listing] ( /code/index_buffer.cpp )
0 commit comments