@@ -324,15 +324,22 @@ class HelloTriangleApplication {
324324
325325 pipelineLayout = vk::raii::PipelineLayout ( device, pipelineLayoutInfo );
326326
327- vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1 , .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
328- vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
329- .stageCount = 2 , .pStages = shaderStages,
330- .pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
331- .pViewportState = &viewportState, .pRasterizationState = &rasterizer,
332- .pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
333- .pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };
334-
335- graphicsPipeline = vk::raii::Pipeline (device, nullptr , pipelineInfo);
327+ vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
328+ {.stageCount = 2 ,
329+ .pStages = shaderStages,
330+ .pVertexInputState = &vertexInputInfo,
331+ .pInputAssemblyState = &inputAssembly,
332+ .pViewportState = &viewportState,
333+ .pRasterizationState = &rasterizer,
334+ .pMultisampleState = &multisampling,
335+ .pColorBlendState = &colorBlending,
336+ .pDynamicState = &dynamicState,
337+ .layout = pipelineLayout,
338+ .renderPass = nullptr },
339+ {.colorAttachmentCount = 1 , .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
340+ };
341+
342+ graphicsPipeline = vk::raii::Pipeline (device, nullptr , pipelineCreateInfoChain.get <vk::GraphicsPipelineCreateInfo>());
336343 }
337344
338345 [[nodiscard]] vk::raii::ShaderModule createShaderModule (const std::vector<char >& code) const {
0 commit comments