First work with vulkano

This commit is contained in:
Florian RICHER 2024-12-08 18:19:37 +01:00
parent cbadffc41f
commit 0597579115
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
36 changed files with 1059 additions and 1847 deletions

View file

@ -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<_>>()
}