From 29fdfebd0d3ad133af2053150cdb4f6f2b8d3f55 Mon Sep 17 00:00:00 2001 From: Minghui Tang Date: Mon, 27 Apr 2026 20:09:30 +0800 Subject: [PATCH] Fix the missing of DescriptorSetLayout in chapter 24/25/26 --- attachments/24_texture_image.cpp | 2 +- attachments/25_sampler.cpp | 2 +- attachments/26_texture_mapping.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attachments/24_texture_image.cpp b/attachments/24_texture_image.cpp index 9b396509..b43d8d24 100644 --- a/attachments/24_texture_image.cpp +++ b/attachments/24_texture_image.cpp @@ -457,7 +457,7 @@ class HelloTriangleApplication std::vector dynamicStates = {vk::DynamicState::eViewport, vk::DynamicState::eScissor}; vk::PipelineDynamicStateCreateInfo dynamicState{.dynamicStateCount = static_cast(dynamicStates.size()), .pDynamicStates = dynamicStates.data()}; - vk::PipelineLayoutCreateInfo pipelineLayoutInfo{.setLayoutCount = 0, .pushConstantRangeCount = 0}; + vk::PipelineLayoutCreateInfo pipelineLayoutInfo{.setLayoutCount = 1, .pSetLayouts=&*descriptorSetLayout, .pushConstantRangeCount = 0}; pipelineLayout = vk::raii::PipelineLayout(device, pipelineLayoutInfo); vk::StructureChain pipelineCreateInfoChain = { diff --git a/attachments/25_sampler.cpp b/attachments/25_sampler.cpp index 17caefd5..f76f2f18 100644 --- a/attachments/25_sampler.cpp +++ b/attachments/25_sampler.cpp @@ -460,7 +460,7 @@ class HelloTriangleApplication std::vector dynamicStates = {vk::DynamicState::eViewport, vk::DynamicState::eScissor}; vk::PipelineDynamicStateCreateInfo dynamicState{.dynamicStateCount = static_cast(dynamicStates.size()), .pDynamicStates = dynamicStates.data()}; - vk::PipelineLayoutCreateInfo pipelineLayoutInfo{.setLayoutCount = 0, .pushConstantRangeCount = 0}; + vk::PipelineLayoutCreateInfo pipelineLayoutInfo{.setLayoutCount = 1, .pSetLayouts=&*descriptorSetLayout, .pushConstantRangeCount = 0}; pipelineLayout = vk::raii::PipelineLayout(device, pipelineLayoutInfo); vk::StructureChain pipelineCreateInfoChain = { diff --git a/attachments/26_texture_mapping.cpp b/attachments/26_texture_mapping.cpp index 7531ef8b..55a015ea 100644 --- a/attachments/26_texture_mapping.cpp +++ b/attachments/26_texture_mapping.cpp @@ -465,7 +465,7 @@ class HelloTriangleApplication std::vector dynamicStates = {vk::DynamicState::eViewport, vk::DynamicState::eScissor}; vk::PipelineDynamicStateCreateInfo dynamicState{.dynamicStateCount = static_cast(dynamicStates.size()), .pDynamicStates = dynamicStates.data()}; - vk::PipelineLayoutCreateInfo pipelineLayoutInfo{.setLayoutCount = 0, .pushConstantRangeCount = 0}; + vk::PipelineLayoutCreateInfo pipelineLayoutInfo{.setLayoutCount = 1, .pSetLayouts=&*descriptorSetLayout, .pushConstantRangeCount = 0}; pipelineLayout = vk::raii::PipelineLayout(device, pipelineLayoutInfo); vk::StructureChain pipelineCreateInfoChain = {