From 5c56308e21a96932784e7c621f22b67fc4a448d9 Mon Sep 17 00:00:00 2001 From: swinston Date: Wed, 19 Aug 2026 13:22:12 -0700 Subject: [PATCH] Address that 22_descriptor_layout.cpp draw call crashes with an explanation and comment out the draw call. --- attachments/22_descriptor_layout.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/attachments/22_descriptor_layout.cpp b/attachments/22_descriptor_layout.cpp index 83355311..c05214dc 100644 --- a/attachments/22_descriptor_layout.cpp +++ b/attachments/22_descriptor_layout.cpp @@ -604,7 +604,11 @@ class HelloTriangleApplication commandBuffer.setScissor(0, vk::Rect2D(vk::Offset2D(0, 0), swapChainExtent)); commandBuffer.bindVertexBuffers(0, *vertexBuffer, {0}); commandBuffer.bindIndexBuffer(*indexBuffer, 0, vk::IndexTypeValue::value); - commandBuffer.drawIndexed(static_cast(indices.size()), 1, 0, 0, 0); + // The draw call is intentionally commented out: the pipeline's shader statically + // uses the descriptor set 0 layout we just declared, but no actual vk::raii::DescriptorSet + // has been created or bound yet - that's introduced in the next chapter. Issuing the draw + // here would fail validation and crash the driver, for educational pacing purposes, we are leaving it commented out for now. + // commandBuffer.drawIndexed(static_cast(indices.size()), 1, 0, 0, 0); commandBuffer.endRendering(); // After rendering, transition the swapchain image to vk::ImageLayout::ePresentSrcKHR