Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bc4507

Browse files
committed
Fix typos in vkAllocateMemory calls
1 parent 5032f89 commit 3bc4507

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

04_Vertex_buffers/01_Vertex_buffer_creation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void initVulkan() {
3434
...
3535

3636
void createVertexBuffer() {
37-
37+
3838
}
3939
```
4040

@@ -204,7 +204,7 @@ VDeleter<VkDeviceMemory> vertexBufferMemory{device, vkFreeMemory};
204204

205205
...
206206

207-
if (vkAllocateMemory(device, &allocInfo, nullptr, &vertexBufferMemory) != VK_SUCCESS) {
207+
if (vkAllocateMemory(device, &allocInfo, nullptr, vertexBufferMemory.replace()) != VK_SUCCESS) {
208208
throw std::runtime_error("failed to allocate vertex buffer memory!");
209209
}
210210
```
@@ -312,4 +312,4 @@ Run the program again and you should see the following:
312312
In the next chapter we'll look at a different way to copy vertex data to a
313313
vertex buffer that results in better performance, but takes some more work.
314314

315-
[Full code listing](/code/vertex_buffer.cpp)
315+
[Full code listing](/code/vertex_buffer.cpp)

04_Vertex_buffers/02_Staging_buffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void createBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyF
6363
allocInfo.allocationSize = memRequirements.size;
6464
allocInfo.memoryTypeIndex = findMemoryType(memRequirements.memoryTypeBits, properties);
6565

66-
if (vkAllocateMemory(device, &allocInfo, nullptr, &bufferMemory) != VK_SUCCESS) {
66+
if (vkAllocateMemory(device, &allocInfo, nullptr, bufferMemory.replace()) != VK_SUCCESS) {
6767
throw std::runtime_error("failed to allocate buffer memory!");
6868
}
6969

@@ -251,4 +251,4 @@ any Vulkan program to properly handle allocations. It's okay to use a separate
251251
allocation for every resource for this tutorial, because we won't come close to
252252
hitting any of these limits for now.
253253

254-
[Full code listing](/code/staging_buffer.cpp)
254+
[Full code listing](/code/staging_buffer.cpp)

0 commit comments

Comments
 (0)