Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Letronix624 committed Feb 12, 2024
1 parent 1d98f1c commit 0bd84c7
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 71 deletions.
51 changes: 22 additions & 29 deletions examples/multisample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,28 +298,24 @@ impl MSAAPipeline {

let subpass = Subpass::from(render_pass, 0).unwrap();
(
GraphicsPipeline::new(
device.clone(),
None,
GraphicsPipelineCreateInfo {
stages: stages.into_iter().collect(),
vertex_input_state: Some(vertex_input_state),
input_assembly_state: Some(InputAssemblyState::default()),
viewport_state: Some(ViewportState::default()),
rasterization_state: Some(RasterizationState::default()),
multisample_state: Some(MultisampleState {
rasterization_samples: subpass.num_samples().unwrap(),
..MultisampleState::default()
}),
color_blend_state: Some(ColorBlendState::with_attachment_states(
subpass.num_color_attachments(),
ColorBlendAttachmentState::default(),
)),
dynamic_state: [DynamicState::Viewport].into_iter().collect(),
subpass: Some(subpass.clone().into()),
..GraphicsPipelineCreateInfo::layout(layout)
},
)
GraphicsPipeline::new(device.clone(), None, GraphicsPipelineCreateInfo {
stages: stages.into_iter().collect(),
vertex_input_state: Some(vertex_input_state),
input_assembly_state: Some(InputAssemblyState::default()),
viewport_state: Some(ViewportState::default()),
rasterization_state: Some(RasterizationState::default()),
multisample_state: Some(MultisampleState {
rasterization_samples: subpass.num_samples().unwrap(),
..MultisampleState::default()
}),
color_blend_state: Some(ColorBlendState::with_attachment_states(
subpass.num_color_attachments(),
ColorBlendAttachmentState::default(),
)),
dynamic_state: [DynamicState::Viewport].into_iter().collect(),
subpass: Some(subpass.clone().into()),
..GraphicsPipelineCreateInfo::layout(layout)
})
.unwrap(),
subpass,
)
Expand Down Expand Up @@ -364,13 +360,10 @@ impl MSAAPipeline {
.unwrap();
}

let framebuffer = Framebuffer::new(
self.render_pass.clone(),
FramebufferCreateInfo {
attachments: vec![self.intermediary.clone(), image],
..Default::default()
},
)
let framebuffer = Framebuffer::new(self.render_pass.clone(), FramebufferCreateInfo {
attachments: vec![self.intermediary.clone(), image],
..Default::default()
})
.unwrap();

// Begin render pipeline commands
Expand Down
53 changes: 23 additions & 30 deletions examples/subpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,21 @@ impl SimpleGuiPipeline {

let subpass = Subpass::from(render_pass, 0).unwrap();
(
GraphicsPipeline::new(
device,
None,
GraphicsPipelineCreateInfo {
stages: stages.into_iter().collect(),
vertex_input_state: Some(vertex_input_state),
input_assembly_state: Some(InputAssemblyState::default()),
viewport_state: Some(ViewportState::default()),
rasterization_state: Some(RasterizationState::default()),
multisample_state: Some(MultisampleState::default()),
color_blend_state: Some(ColorBlendState::with_attachment_states(
subpass.num_color_attachments(),
ColorBlendAttachmentState::default(),
)),
dynamic_state: [DynamicState::Viewport].into_iter().collect(),
subpass: Some(subpass.clone().into()),
..GraphicsPipelineCreateInfo::layout(layout)
},
)
GraphicsPipeline::new(device, None, GraphicsPipelineCreateInfo {
stages: stages.into_iter().collect(),
vertex_input_state: Some(vertex_input_state),
input_assembly_state: Some(InputAssemblyState::default()),
viewport_state: Some(ViewportState::default()),
rasterization_state: Some(RasterizationState::default()),
multisample_state: Some(MultisampleState::default()),
color_blend_state: Some(ColorBlendState::with_attachment_states(
subpass.num_color_attachments(),
ColorBlendAttachmentState::default(),
)),
dynamic_state: [DynamicState::Viewport].into_iter().collect(),
subpass: Some(subpass.clone().into()),
..GraphicsPipelineCreateInfo::layout(layout)
})
.unwrap(),
subpass,
)
Expand All @@ -295,10 +291,10 @@ impl SimpleGuiPipeline {
.unwrap();

let dimensions = image.image().extent();
let framebuffer = Framebuffer::new(
self.render_pass.clone(),
FramebufferCreateInfo { attachments: vec![image], ..Default::default() },
)
let framebuffer = Framebuffer::new(self.render_pass.clone(), FramebufferCreateInfo {
attachments: vec![image],
..Default::default()
})
.unwrap();

// Begin render pipeline commands
Expand Down Expand Up @@ -353,13 +349,10 @@ impl SimpleGuiPipeline {

// Move on to next subpass for gui
builder
.next_subpass(
Default::default(),
SubpassBeginInfo {
contents: SubpassContents::SecondaryCommandBuffers,
..Default::default()
},
)
.next_subpass(Default::default(), SubpassBeginInfo {
contents: SubpassContents::SecondaryCommandBuffers,
..Default::default()
})
.unwrap();
// Draw gui on subpass
let cb = gui.draw_on_subpass_image([dimensions[0], dimensions[1]]);
Expand Down
22 changes: 10 additions & 12 deletions examples/wholesome/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,26 @@ impl GuiState {
.vscroll(true)
.open(show_texture_window1)
.show(&egui_context, |ui| {
ui.image(ImageSource::Texture(SizedTexture::new(
*image_texture_id1,
[256.0, 256.0],
)));
ui.image(ImageSource::Texture(SizedTexture::new(*image_texture_id1, [
256.0, 256.0,
])));
});
egui::Window::new("Mah Doge")
.resizable(true)
.vscroll(true)
.open(show_texture_window2)
.show(&egui_context, |ui| {
ui.image(ImageSource::Texture(SizedTexture::new(
*image_texture_id2,
[300.0, 200.0],
)));
ui.image(ImageSource::Texture(SizedTexture::new(*image_texture_id2, [
300.0, 200.0,
])));
});
egui::Window::new("Scene").resizable(true).vscroll(true).open(show_scene_window).show(
&egui_context,
|ui| {
ui.image(ImageSource::Texture(SizedTexture::new(
*scene_texture_id,
[scene_view_size[0] as f32, scene_view_size[1] as f32],
)));
ui.image(ImageSource::Texture(SizedTexture::new(*scene_texture_id, [
scene_view_size[0] as f32,
scene_view_size[1] as f32,
])));
},
);
egui::Area::new("fps")
Expand Down

0 comments on commit 0bd84c7

Please sign in to comment.