Skip to content

Commit 721e2c2

Browse files
authored
Merge pull request #207 from asuessenbach/15_hello_triangle
Comment usage of waitIdle in chapter 15
2 parents 017a919 + 6a4c0cc commit 721e2c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

attachments/15_hello_triangle.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ class HelloTriangleApplication {
101101
glfwPollEvents();
102102
drawFrame();
103103
}
104-
105-
device.waitIdle();
104+
device.waitIdle(); // wait for device to finish operations before destroying resources
106105
}
107106

108107
void cleanup() {
@@ -456,7 +455,8 @@ class HelloTriangleApplication {
456455
}
457456

458457
void drawFrame() {
459-
queue.waitIdle();
458+
queue.waitIdle(); // NOTE: for simplicity, wait for the queue to be idle before starting the frame
459+
// In the next chapter you see how to use multiple frames in flight and fences to sync
460460

461461
auto [result, imageIndex] = swapChain.acquireNextImage( UINT64_MAX, *presentCompleteSemaphore, nullptr );
462462
recordCommandBuffer(imageIndex);

0 commit comments

Comments
 (0)