@@ -330,15 +330,22 @@ class HelloTriangleApplication {
330330
331331 pipelineLayout = vk::raii::PipelineLayout ( device, pipelineLayoutInfo );
332332
333- vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1 , .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
334- vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
335- .stageCount = 2 , .pStages = shaderStages,
336- .pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
337- .pViewportState = &viewportState, .pRasterizationState = &rasterizer,
338- .pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
339- .pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };
340-
341- graphicsPipeline = vk::raii::Pipeline (device, nullptr , pipelineInfo);
333+ vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
334+ {.stageCount = 2 ,
335+ .pStages = shaderStages,
336+ .pVertexInputState = &vertexInputInfo,
337+ .pInputAssemblyState = &inputAssembly,
338+ .pViewportState = &viewportState,
339+ .pRasterizationState = &rasterizer,
340+ .pMultisampleState = &multisampling,
341+ .pColorBlendState = &colorBlending,
342+ .pDynamicState = &dynamicState,
343+ .layout = pipelineLayout,
344+ .renderPass = nullptr },
345+ {.colorAttachmentCount = 1 , .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
346+ };
347+
348+ graphicsPipeline = vk::raii::Pipeline (device, nullptr , pipelineCreateInfoChain.get <vk::GraphicsPipelineCreateInfo>());
342349 }
343350
344351 void createCommandPool () {
0 commit comments