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