Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions attachments/12_graphics_pipeline_complete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

[[nodiscard]] vk::raii::ShaderModule createShaderModule(const std::vector<char>& code) const {
Expand Down
25 changes: 16 additions & 9 deletions attachments/14_command_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/15_hello_triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/16_frames_in_flight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/17_swap_chain_recreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/18_vertex_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/19_vertex_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/20_staging_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/21_index_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/22_descriptor_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
25 changes: 16 additions & 9 deletions attachments/23_descriptor_sets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,22 @@ class HelloTriangleApplication {

pipelineLayout = vk::raii::PipelineLayout( device, pipelineLayoutInfo );

vk::PipelineRenderingCreateInfo pipelineRenderingCreateInfo{ .colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format };
vk::GraphicsPipelineCreateInfo pipelineInfo{ .pNext = &pipelineRenderingCreateInfo,
.stageCount = 2, .pStages = shaderStages,
.pVertexInputState = &vertexInputInfo, .pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState, .pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling, .pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState, .layout = pipelineLayout, .renderPass = nullptr };

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineInfo);
vk::StructureChain<vk::GraphicsPipelineCreateInfo, vk::PipelineRenderingCreateInfo> pipelineCreateInfoChain = {
{.stageCount = 2,
.pStages = shaderStages,
.pVertexInputState = &vertexInputInfo,
.pInputAssemblyState = &inputAssembly,
.pViewportState = &viewportState,
.pRasterizationState = &rasterizer,
.pMultisampleState = &multisampling,
.pColorBlendState = &colorBlending,
.pDynamicState = &dynamicState,
.layout = pipelineLayout,
.renderPass = nullptr },
{.colorAttachmentCount = 1, .pColorAttachmentFormats = &swapChainSurfaceFormat.format }
};

graphicsPipeline = vk::raii::Pipeline(device, nullptr, pipelineCreateInfoChain.get<vk::GraphicsPipelineCreateInfo>());
}

void createCommandPool() {
Expand Down
Loading
Loading