First work with vulkano
This commit is contained in:
parent
cbadffc41f
commit
0597579115
36 changed files with 1059 additions and 1847 deletions
|
@ -1,9 +1,19 @@
|
|||
mod render_context;
|
||||
mod app;
|
||||
pub use app::App;
|
||||
|
||||
mod scene;
|
||||
pub use scene::Scene;
|
||||
|
||||
use std::sync::Arc;
|
||||
use ash::vk;
|
||||
use vulkano::image::Image;
|
||||
use vulkano::image::view::ImageView;
|
||||
|
||||
pub mod vulkan;
|
||||
|
||||
pub trait Renderable {
|
||||
fn init(&mut self, device: &Arc<vulkan::VkDevice>, render_pass: &Arc<vulkan::VkRenderPass>) -> anyhow::Result<()>;
|
||||
fn render(&self, device: &vulkan::VkDevice, swapchain: &vulkan::VkSwapchain, command_buffer: &vk::CommandBuffer) -> anyhow::Result<()>;
|
||||
}
|
||||
/// This function is called once during initialization, then again whenever the window is resized.
|
||||
fn window_size_dependent_setup(images: &[Arc<Image>]) -> Vec<Arc<ImageView>> {
|
||||
images
|
||||
.iter()
|
||||
.map(|image| ImageView::new_default(image.clone()).unwrap())
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue