Finish the pipeline
This commit is contained in:
parent
2ea377d91f
commit
1059dc028c
@ -60,6 +60,7 @@ impl App {
|
||||
|
||||
/// Destroys our Vulkan app.
|
||||
pub unsafe fn destroy(&mut self) {
|
||||
self.device.destroy_pipeline(self.data.pipeline, None);
|
||||
self.device
|
||||
.destroy_pipeline_layout(self.data.pipeline_layout, None);
|
||||
self.device.destroy_render_pass(self.data.render_pass, None);
|
||||
@ -99,6 +100,7 @@ pub struct AppData {
|
||||
swapchain_image_views: Vec<vk::ImageView>,
|
||||
render_pass: vk::RenderPass,
|
||||
pipeline_layout: vk::PipelineLayout,
|
||||
pipeline: vk::Pipeline,
|
||||
}
|
||||
|
||||
impl AppData {}
|
||||
|
@ -483,6 +483,23 @@ pub(super) unsafe fn create_pipeline(device: &Device, data: &mut AppData) -> Res
|
||||
let layout_info = vk::PipelineLayoutCreateInfo::builder();
|
||||
data.pipeline_layout = device.create_pipeline_layout(&layout_info, None)?;
|
||||
|
||||
let stages = &[vert_stage, frag_stage];
|
||||
let info = vk::GraphicsPipelineCreateInfo::builder()
|
||||
.stages(stages)
|
||||
.vertex_input_state(&vertex_input_state)
|
||||
.input_assembly_state(&input_assembly_state)
|
||||
.viewport_state(&viewport_state)
|
||||
.rasterization_state(&rasterization_state)
|
||||
.multisample_state(&multisample_state)
|
||||
.color_blend_state(&color_blend_state)
|
||||
.layout(data.pipeline_layout)
|
||||
.render_pass(data.render_pass)
|
||||
.subpass(0);
|
||||
|
||||
data.pipeline = device
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &[info], None)?
|
||||
.0;
|
||||
|
||||
// Cleanup
|
||||
device.destroy_shader_module(vert_shader_module, None);
|
||||
device.destroy_shader_module(frag_shader_module, None);
|
||||
|
Loading…
Reference in New Issue
Block a user