Split crates
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 7m49s

This commit is contained in:
Florian RICHER 2025-05-18 13:15:29 +02:00
parent 99be029ff8
commit b977f446d3
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
16 changed files with 84 additions and 110 deletions

104
Cargo.lock generated
View file

@ -117,12 +117,6 @@ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]]
name = "anyhow"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
[[package]] [[package]]
name = "arrayref" name = "arrayref"
version = "0.3.9" version = "0.3.9"
@ -676,6 +670,32 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
[[package]]
name = "engine_vulkan"
version = "0.1.0"
dependencies = [
"bevy_app",
"bevy_ecs",
"engine_window",
"env_logger",
"log",
"thiserror 2.0.12",
"vulkano",
"winit",
]
[[package]]
name = "engine_window"
version = "0.1.0"
dependencies = [
"bevy_app",
"bevy_ecs",
"env_logger",
"log",
"thiserror 2.0.12",
"winit",
]
[[package]] [[package]]
name = "env_filter" name = "env_filter"
version = "0.1.3" version = "0.1.3"
@ -986,7 +1006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.53.0", "windows-targets 0.52.6",
] ]
[[package]] [[package]]
@ -1621,13 +1641,13 @@ dependencies = [
name = "rust_vulkan_test" name = "rust_vulkan_test"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow",
"bevy_app", "bevy_app",
"bevy_ecs", "bevy_ecs",
"engine_vulkan",
"engine_window",
"env_logger", "env_logger",
"glam 0.30.3", "glam 0.30.3",
"log", "log",
"thiserror 2.0.12",
"vulkano", "vulkano",
"vulkano-shaders", "vulkano-shaders",
"winit", "winit",
@ -2386,29 +2406,13 @@ dependencies = [
"windows_aarch64_gnullvm 0.52.6", "windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6", "windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6", "windows_i686_gnu 0.52.6",
"windows_i686_gnullvm 0.52.6", "windows_i686_gnullvm",
"windows_i686_msvc 0.52.6", "windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6", "windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6", "windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6", "windows_x86_64_msvc 0.52.6",
] ]
[[package]]
name = "windows-targets"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b"
dependencies = [
"windows_aarch64_gnullvm 0.53.0",
"windows_aarch64_msvc 0.53.0",
"windows_i686_gnu 0.53.0",
"windows_i686_gnullvm 0.53.0",
"windows_i686_msvc 0.53.0",
"windows_x86_64_gnu 0.53.0",
"windows_x86_64_gnullvm 0.53.0",
"windows_x86_64_msvc 0.53.0",
]
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
version = "0.42.2" version = "0.42.2"
@ -2427,12 +2431,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.42.2" version = "0.42.2"
@ -2451,12 +2449,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.42.2" version = "0.42.2"
@ -2475,24 +2467,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
[[package]] [[package]]
name = "windows_i686_gnullvm" name = "windows_i686_gnullvm"
version = "0.52.6" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.42.2" version = "0.42.2"
@ -2511,12 +2491,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_i686_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.42.2" version = "0.42.2"
@ -2535,12 +2509,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.42.2" version = "0.42.2"
@ -2559,12 +2527,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.42.2" version = "0.42.2"
@ -2583,12 +2545,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]] [[package]]
name = "winit" name = "winit"
version = "0.30.10" version = "0.30.10"

View file

@ -5,7 +5,11 @@ edition = "2024"
authors = ["Florian RICHER <florian.richer@protonmail.com>"] authors = ["Florian RICHER <florian.richer@protonmail.com>"]
publish = false publish = false
[dependencies] [workspace]
resolver = "2"
members = ["crates/*"]
[workspace.dependencies]
anyhow = "1.0" anyhow = "1.0"
thiserror = "2.0" thiserror = "2.0"
winit = { version = "0.30", features = ["rwh_06"] } winit = { version = "0.30", features = ["rwh_06"] }
@ -23,3 +27,19 @@ bevy_app = "0.16"
# Log and tracing # Log and tracing
log = "0.4" log = "0.4"
env_logger = "0.11" env_logger = "0.11"
engine_vulkan = { path = "crates/engine_vulkan" }
engine_window = { path = "crates/engine_window" }
[dependencies]
log = { workspace = true }
env_logger = { workspace = true }
bevy_app = { workspace = true }
bevy_ecs = { workspace = true }
winit = { workspace = true }
vulkano = { workspace = true }
vulkano-shaders = { workspace = true }
glam = { workspace = true }
engine_vulkan = { workspace = true }
engine_window = { workspace = true }

View file

@ -0,0 +1,14 @@
[package]
name = "engine_vulkan"
version = "0.1.0"
edition = "2024"
[dependencies]
thiserror = { workspace = true }
log = { workspace = true }
env_logger = { workspace = true }
bevy_app = { workspace = true }
bevy_ecs = { workspace = true }
winit = { workspace = true }
vulkano = { workspace = true }
engine_window = { workspace = true }

View file

@ -1,10 +1,9 @@
use engine_window::raw_handle::WindowWrapper;
use vulkan_context::VulkanContext; use vulkan_context::VulkanContext;
use window_render_context::WindowRenderContext; use window_render_context::WindowRenderContext;
use bevy_app::{App, Plugin}; use bevy_app::{App, Plugin};
use super::window::raw_handle::WindowWrapper;
mod utils; mod utils;
mod vulkan_context; mod vulkan_context;
mod window_render_context; mod window_render_context;

View file

@ -2,6 +2,7 @@ use std::{any::Any, sync::Arc};
use bevy_app::App; use bevy_app::App;
use bevy_ecs::resource::Resource; use bevy_ecs::resource::Resource;
use engine_window::raw_handle::DisplayHandleWrapper;
use vulkano::{ use vulkano::{
command_buffer::{ command_buffer::{
AutoCommandBufferBuilder, CommandBufferUsage, PrimaryAutoCommandBuffer, AutoCommandBufferBuilder, CommandBufferUsage, PrimaryAutoCommandBuffer,
@ -15,8 +16,6 @@ use vulkano::{
}; };
use winit::raw_window_handle::{HasDisplayHandle, HasWindowHandle}; use winit::raw_window_handle::{HasDisplayHandle, HasWindowHandle};
use crate::core::window::raw_handle::DisplayHandleWrapper;
use super::utils; use super::utils;
#[derive(Resource)] #[derive(Resource)]

View file

@ -1,5 +1,6 @@
use bevy_app::App; use bevy_app::App;
use bevy_ecs::resource::Resource; use bevy_ecs::resource::Resource;
use engine_window::raw_handle::WindowWrapper;
use std::sync::Arc; use std::sync::Arc;
use vulkano::image::view::ImageView; use vulkano::image::view::ImageView;
use vulkano::image::{Image, ImageUsage}; use vulkano::image::{Image, ImageUsage};
@ -9,8 +10,6 @@ use vulkano::sync::{self, GpuFuture};
use vulkano::{Validated, VulkanError}; use vulkano::{Validated, VulkanError};
use winit::window::Window; use winit::window::Window;
use crate::core::window::raw_handle::WindowWrapper;
use super::vulkan_context::VulkanContext; use super::vulkan_context::VulkanContext;
#[derive(Resource)] #[derive(Resource)]

View file

@ -0,0 +1,12 @@
[package]
name = "engine_window"
version = "0.1.0"
edition = "2024"
[dependencies]
thiserror = { workspace = true }
log = { workspace = true }
env_logger = { workspace = true }
bevy_app = { workspace = true }
bevy_ecs = { workspace = true }
winit = { workspace = true }

View file

@ -47,7 +47,6 @@ impl ApplicationHandler for WindowState {
event_loop.exit(); event_loop.exit();
} }
WindowEvent::RedrawRequested => { WindowEvent::RedrawRequested => {
log::debug!("The window was requested to be redrawn");
if self.app.plugins_state() == PluginsState::Cleaned { if self.app.plugins_state() == PluginsState::Cleaned {
self.app.update(); self.app.update();
} }

View file

@ -65,7 +65,7 @@
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d:${pkgs.renderdoc}/share/vulkan/implicit_layer.d"; VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d:${pkgs.renderdoc}/share/vulkan/implicit_layer.d";
RUST_LOG = "info,rust_vulkan_test=trace"; RUST_LOG = "trace,rust_vulkan_test=trace";
}; };
in in
{ {

View file

@ -1,4 +1,2 @@
pub mod camera; pub mod camera;
pub mod render; pub mod render;
pub mod vulkan;
pub mod window;

View file

@ -1,11 +1,6 @@
use bevy_app::App; use bevy_app::App;
use engine_vulkan::VulkanPlugin;
use crate::core::{ use engine_window::{WindowPlugin, config::WindowConfig};
vulkan,
window::{self, config::WindowConfig},
};
pub mod test_plugin;
pub fn init(app: &mut App) { pub fn init(app: &mut App) {
let window_config = WindowConfig { let window_config = WindowConfig {
@ -14,11 +9,7 @@ pub fn init(app: &mut App) {
height: 600, height: 600,
}; };
app.add_plugins(( app.add_plugins((WindowPlugin { window_config }, VulkanPlugin));
test_plugin::TestPlugin,
window::WindowPlugin { window_config },
vulkan::VulkanPlugin,
));
// Window::new(app, window_config).unwrap(); // Window::new(app, window_config).unwrap();
// Vulkan::new(app).unwrap(); // Vulkan::new(app).unwrap();
} }

View file

@ -1,13 +0,0 @@
use bevy_app::{App, Last, Plugin, Startup};
pub struct TestPlugin;
impl Plugin for TestPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Last, setup_system);
}
}
fn setup_system() {
log::info!("Hello, world!");
}