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

Skip to content

Commit 0abd602

Browse files
committed
Fix wrong code in validation layers chapter
1 parent a0e9c63 commit 0abd602

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

03_Drawing_a_triangle/00_Setup/02_Validation_layers.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ couldn't be loaded. We can now call this function to create the extension
315315
object if it's available:
316316
317317
```c++
318-
if (CreateDebugReportCallbackEXT(instance, &createInfo, nullptr, callback.replace()) != VK_SUCCESS) {
318+
if (CreateDebugReportCallbackEXT(instance, &createInfo, nullptr, callback) != VK_SUCCESS) {
319319
throw std::runtime_error("failed to set up debug callback!");
320320
}
321321
```
@@ -348,6 +348,13 @@ We can then specify it as cleanup function:
348348
VDeleter<VkDebugReportCallbackEXT> callback{instance, DestroyDebugReportCallbackEXT};
349349
```
350350

351+
Make sure to change the line that creates the debug report callback to use the
352+
`replace()` method of the wrapper:
353+
354+
```c++
355+
if (CreateDebugReportCallbackEXT(instance, &createInfo, nullptr, callback.replace()) != VK_SUCCESS) {
356+
```
357+
351358
When you run the program again you'll see that the error message has
352359
disappeared. If you want to see which call triggered a message, you can add a
353360
breakpoint to the message callback and look at the stack trace.

0 commit comments

Comments
 (0)