vulkan: Move to renderer module
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 1s

This commit is contained in:
Florian RICHER 2024-11-27 20:59:39 +01:00
parent 001547dbc2
commit a669247406
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
21 changed files with 61 additions and 63 deletions

View file

@ -1,5 +1,5 @@
use crate::display::window::Window;
use crate::vulkan::VkRenderContext;
use crate::renderer::vulkan::VkRenderContext;
use winit::application::ApplicationHandler;
use winit::event::WindowEvent;
use winit::event_loop::ActiveEventLoop;

View file

@ -1,7 +1,7 @@
use winit::event_loop::{ControlFlow, EventLoop};
mod display;
mod vulkan;
mod renderer;
fn main() {
env_logger::init();

1
src/renderer/mod.rs Normal file
View file

@ -0,0 +1 @@
pub mod vulkan;

View file

@ -0,0 +1,41 @@
mod vk_render_context;
pub use vk_render_context::VkRenderContext;
mod vk_instance;
pub use vk_instance::VkInstance;
mod vk_surface;
pub use vk_surface::{SwapchainSupportDetails, VkSurface};
mod vk_physical_device;
pub use vk_physical_device::VkPhysicalDevice;
mod vk_device;
pub use vk_device::VkDevice;
mod vk_swapchain;
pub use vk_swapchain::VkSwapchain;
mod vk_shader_module;
pub use vk_shader_module::VkShaderModule;
mod vk_graphics_pipeline;
pub use vk_graphics_pipeline::VkGraphicsPipeline;
mod vk_render_pass;
pub use vk_render_pass::VkRenderPass;
mod vk_semaphore;
pub use vk_semaphore::VkSemaphore;
mod vk_command_pool;
pub use vk_command_pool::VkCommandPool;
mod vk_framebuffer;
pub use vk_framebuffer::VkFramebuffer;
mod vk_fence;
pub use vk_fence::VkFence;
mod utils;
mod vertex;

View file

@ -1,4 +1,4 @@
use crate::vulkan::VkDevice;
use super::VkDevice;
use ash::prelude::VkResult;
use ash::vk;
use std::sync::Arc;

View file

@ -1,4 +1,4 @@
use crate::vulkan::{VkInstance, VkPhysicalDevice};
use super::{VkInstance, VkPhysicalDevice};
use ash::prelude::VkResult;
use ash::vk;
use std::sync::Arc;

View file

@ -1,4 +1,4 @@
use crate::vulkan::VkDevice;
use super::VkDevice;
use ash::vk;
use std::sync::Arc;

View file

@ -1,5 +1,4 @@
use crate::vulkan::vk_render_pass::VkRenderPass;
use crate::vulkan::{VkDevice, VkSwapchain};
use super::{VkDevice, VkRenderPass, VkSwapchain};
use ash::vk;
use std::sync::Arc;

View file

@ -1,5 +1,4 @@
use crate::vulkan::vk_render_pass::VkRenderPass;
use crate::vulkan::{VkDevice, VkShaderModule, VkSwapchain};
use super::{VkDevice, VkRenderPass, VkShaderModule, VkSwapchain};
use ash::vk;
use std::ffi::CStr;
use std::sync::Arc;

View file

@ -1,5 +1,7 @@
use crate::vulkan::utils::layers::{use_layers, LayersSelector};
use crate::vulkan::VkPhysicalDevice;
use crate::renderer::vulkan::{
utils::layers::{use_layers, LayersSelector},
VkPhysicalDevice,
};
use ash::khr::surface;
use ash::{vk, Entry, Instance};
use std::ffi::{c_char, CStr, CString};
@ -26,7 +28,7 @@ impl VkInstance {
layer_property.layer_name_as_c_str().ok(),
)
}
.unwrap_or_default();
.unwrap_or_default();
log::debug!("{layer_property:#?} {layer_extensions:#?}");
}
}

View file

@ -1,4 +1,4 @@
use crate::vulkan::vk_surface::VkSurface;
use super::VkSurface;
use ash::vk;
pub struct VkPhysicalDevice {

View file

@ -1,4 +1,4 @@
use crate::vulkan::{
use super::{
VkCommandPool, VkDevice, VkFence, VkFramebuffer, VkGraphicsPipeline, VkInstance, VkPhysicalDevice,
VkRenderPass, VkSemaphore, VkSurface, VkSwapchain,
};

View file

@ -1,4 +1,4 @@
use crate::vulkan::{VkDevice, VkSwapchain};
use super::{VkDevice, VkSwapchain};
use ash::prelude::VkResult;
use ash::vk;
use std::sync::Arc;

View file

@ -1,4 +1,4 @@
use crate::vulkan::VkDevice;
use super::VkDevice;
use ash::vk;
use std::sync::Arc;

View file

@ -1,4 +1,4 @@
use crate::vulkan::VkDevice;
use super::VkDevice;
use ash::vk;
use std::path::Path;
use std::sync::Arc;

View file

@ -1,4 +1,4 @@
use crate::vulkan::{VkInstance, VkPhysicalDevice};
use super::{VkInstance, VkPhysicalDevice};
use ash::prelude::VkResult;
use ash::vk;
use std::sync::Arc;

View file

@ -1,8 +1,5 @@
use super::{SwapchainSupportDetails, VkDevice, VkFramebuffer, VkPhysicalDevice, VkRenderPass, VkSemaphore, VkSurface};
use crate::display::Window;
use crate::vulkan::vk_render_pass::VkRenderPass;
use crate::vulkan::vk_semaphore::VkSemaphore;
use crate::vulkan::vk_surface::SwapchainSupportDetails;
use crate::vulkan::{VkDevice, VkFramebuffer, VkPhysicalDevice, VkSurface};
use ash::prelude::VkResult;
use ash::vk;
use std::sync::Arc;

View file

@ -1,41 +0,0 @@
pub(self) mod vk_render_context;
pub use vk_render_context::VkRenderContext;
pub(self) mod vk_instance;
pub use vk_instance::VkInstance;
pub(self) mod vk_surface;
pub use vk_surface::VkSurface;
pub(self) mod vk_physical_device;
pub use vk_physical_device::VkPhysicalDevice;
pub(self) mod vk_device;
pub use vk_device::VkDevice;
pub(self) mod vk_swapchain;
pub use vk_swapchain::VkSwapchain;
pub(self) mod vk_shader_module;
pub use vk_shader_module::VkShaderModule;
pub(self) mod vk_graphics_pipeline;
pub use vk_graphics_pipeline::VkGraphicsPipeline;
mod vk_render_pass;
pub(self) use vk_render_pass::VkRenderPass;
mod vk_semaphore;
pub(self) use vk_semaphore::VkSemaphore;
mod vk_command_pool;
pub(self) use vk_command_pool::VkCommandPool;
mod vk_framebuffer;
pub(self) use vk_framebuffer::VkFramebuffer;
mod vk_fence;
pub(self) use vk_fence::VkFence;
mod utils;
mod vertex;