vulkan: Move to renderer module
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 1s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 1s
This commit is contained in:
parent
001547dbc2
commit
a669247406
21 changed files with 61 additions and 63 deletions
|
@ -1,5 +1,5 @@
|
||||||
use crate::display::window::Window;
|
use crate::display::window::Window;
|
||||||
use crate::vulkan::VkRenderContext;
|
use crate::renderer::vulkan::VkRenderContext;
|
||||||
use winit::application::ApplicationHandler;
|
use winit::application::ApplicationHandler;
|
||||||
use winit::event::WindowEvent;
|
use winit::event::WindowEvent;
|
||||||
use winit::event_loop::ActiveEventLoop;
|
use winit::event_loop::ActiveEventLoop;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use winit::event_loop::{ControlFlow, EventLoop};
|
use winit::event_loop::{ControlFlow, EventLoop};
|
||||||
|
|
||||||
mod display;
|
mod display;
|
||||||
mod vulkan;
|
mod renderer;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
1
src/renderer/mod.rs
Normal file
1
src/renderer/mod.rs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
pub mod vulkan;
|
41
src/renderer/vulkan/mod.rs
Normal file
41
src/renderer/vulkan/mod.rs
Normal 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;
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::VkDevice;
|
use super::VkDevice;
|
||||||
use ash::prelude::VkResult;
|
use ash::prelude::VkResult;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::{VkInstance, VkPhysicalDevice};
|
use super::{VkInstance, VkPhysicalDevice};
|
||||||
use ash::prelude::VkResult;
|
use ash::prelude::VkResult;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::VkDevice;
|
use super::VkDevice;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::vulkan::vk_render_pass::VkRenderPass;
|
use super::{VkDevice, VkRenderPass, VkSwapchain};
|
||||||
use crate::vulkan::{VkDevice, VkSwapchain};
|
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::vulkan::vk_render_pass::VkRenderPass;
|
use super::{VkDevice, VkRenderPass, VkShaderModule, VkSwapchain};
|
||||||
use crate::vulkan::{VkDevice, VkShaderModule, VkSwapchain};
|
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -1,5 +1,7 @@
|
||||||
use crate::vulkan::utils::layers::{use_layers, LayersSelector};
|
use crate::renderer::vulkan::{
|
||||||
use crate::vulkan::VkPhysicalDevice;
|
utils::layers::{use_layers, LayersSelector},
|
||||||
|
VkPhysicalDevice,
|
||||||
|
};
|
||||||
use ash::khr::surface;
|
use ash::khr::surface;
|
||||||
use ash::{vk, Entry, Instance};
|
use ash::{vk, Entry, Instance};
|
||||||
use std::ffi::{c_char, CStr, CString};
|
use std::ffi::{c_char, CStr, CString};
|
||||||
|
@ -26,7 +28,7 @@ impl VkInstance {
|
||||||
layer_property.layer_name_as_c_str().ok(),
|
layer_property.layer_name_as_c_str().ok(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
log::debug!("{layer_property:#?} {layer_extensions:#?}");
|
log::debug!("{layer_property:#?} {layer_extensions:#?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::vk_surface::VkSurface;
|
use super::VkSurface;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
|
|
||||||
pub struct VkPhysicalDevice {
|
pub struct VkPhysicalDevice {
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::{
|
use super::{
|
||||||
VkCommandPool, VkDevice, VkFence, VkFramebuffer, VkGraphicsPipeline, VkInstance, VkPhysicalDevice,
|
VkCommandPool, VkDevice, VkFence, VkFramebuffer, VkGraphicsPipeline, VkInstance, VkPhysicalDevice,
|
||||||
VkRenderPass, VkSemaphore, VkSurface, VkSwapchain,
|
VkRenderPass, VkSemaphore, VkSurface, VkSwapchain,
|
||||||
};
|
};
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::{VkDevice, VkSwapchain};
|
use super::{VkDevice, VkSwapchain};
|
||||||
use ash::prelude::VkResult;
|
use ash::prelude::VkResult;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::VkDevice;
|
use super::VkDevice;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::VkDevice;
|
use super::VkDevice;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::vulkan::{VkInstance, VkPhysicalDevice};
|
use super::{VkInstance, VkPhysicalDevice};
|
||||||
use ash::prelude::VkResult;
|
use ash::prelude::VkResult;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -1,8 +1,5 @@
|
||||||
|
use super::{SwapchainSupportDetails, VkDevice, VkFramebuffer, VkPhysicalDevice, VkRenderPass, VkSemaphore, VkSurface};
|
||||||
use crate::display::Window;
|
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::prelude::VkResult;
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -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;
|
|
Loading…
Reference in a new issue