Split crates
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 7m49s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 7m49s
This commit is contained in:
parent
99be029ff8
commit
b977f446d3
16 changed files with 84 additions and 110 deletions
104
Cargo.lock
generated
104
Cargo.lock
generated
|
@ -117,12 +117,6 @@ dependencies = [
|
|||
"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]]
|
||||
name = "arrayref"
|
||||
version = "0.3.9"
|
||||
|
@ -676,6 +670,32 @@ version = "0.1.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
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]]
|
||||
name = "env_filter"
|
||||
version = "0.1.3"
|
||||
|
@ -986,7 +1006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-targets 0.53.0",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1621,13 +1641,13 @@ dependencies = [
|
|||
name = "rust_vulkan_test"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bevy_app",
|
||||
"bevy_ecs",
|
||||
"engine_vulkan",
|
||||
"engine_window",
|
||||
"env_logger",
|
||||
"glam 0.30.3",
|
||||
"log",
|
||||
"thiserror 2.0.12",
|
||||
"vulkano",
|
||||
"vulkano-shaders",
|
||||
"winit",
|
||||
|
@ -2386,29 +2406,13 @@ dependencies = [
|
|||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 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_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 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]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.42.2"
|
||||
|
@ -2427,12 +2431,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.42.2"
|
||||
|
@ -2451,12 +2449,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.42.2"
|
||||
|
@ -2475,24 +2467,12 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.42.2"
|
||||
|
@ -2511,12 +2491,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.42.2"
|
||||
|
@ -2535,12 +2509,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
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]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.42.2"
|
||||
|
@ -2559,12 +2527,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
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]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.42.2"
|
||||
|
@ -2583,12 +2545,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
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]]
|
||||
name = "winit"
|
||||
version = "0.30.10"
|
||||
|
|
22
Cargo.toml
22
Cargo.toml
|
@ -5,7 +5,11 @@ edition = "2024"
|
|||
authors = ["Florian RICHER <florian.richer@protonmail.com>"]
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["crates/*"]
|
||||
|
||||
[workspace.dependencies]
|
||||
anyhow = "1.0"
|
||||
thiserror = "2.0"
|
||||
winit = { version = "0.30", features = ["rwh_06"] }
|
||||
|
@ -23,3 +27,19 @@ bevy_app = "0.16"
|
|||
# Log and tracing
|
||||
log = "0.4"
|
||||
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 }
|
||||
|
|
14
crates/engine_vulkan/Cargo.toml
Normal file
14
crates/engine_vulkan/Cargo.toml
Normal 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 }
|
|
@ -1,10 +1,9 @@
|
|||
use engine_window::raw_handle::WindowWrapper;
|
||||
use vulkan_context::VulkanContext;
|
||||
use window_render_context::WindowRenderContext;
|
||||
|
||||
use bevy_app::{App, Plugin};
|
||||
|
||||
use super::window::raw_handle::WindowWrapper;
|
||||
|
||||
mod utils;
|
||||
mod vulkan_context;
|
||||
mod window_render_context;
|
|
@ -2,6 +2,7 @@ use std::{any::Any, sync::Arc};
|
|||
|
||||
use bevy_app::App;
|
||||
use bevy_ecs::resource::Resource;
|
||||
use engine_window::raw_handle::DisplayHandleWrapper;
|
||||
use vulkano::{
|
||||
command_buffer::{
|
||||
AutoCommandBufferBuilder, CommandBufferUsage, PrimaryAutoCommandBuffer,
|
||||
|
@ -15,8 +16,6 @@ use vulkano::{
|
|||
};
|
||||
use winit::raw_window_handle::{HasDisplayHandle, HasWindowHandle};
|
||||
|
||||
use crate::core::window::raw_handle::DisplayHandleWrapper;
|
||||
|
||||
use super::utils;
|
||||
|
||||
#[derive(Resource)]
|
|
@ -1,5 +1,6 @@
|
|||
use bevy_app::App;
|
||||
use bevy_ecs::resource::Resource;
|
||||
use engine_window::raw_handle::WindowWrapper;
|
||||
use std::sync::Arc;
|
||||
use vulkano::image::view::ImageView;
|
||||
use vulkano::image::{Image, ImageUsage};
|
||||
|
@ -9,8 +10,6 @@ use vulkano::sync::{self, GpuFuture};
|
|||
use vulkano::{Validated, VulkanError};
|
||||
use winit::window::Window;
|
||||
|
||||
use crate::core::window::raw_handle::WindowWrapper;
|
||||
|
||||
use super::vulkan_context::VulkanContext;
|
||||
|
||||
#[derive(Resource)]
|
12
crates/engine_window/Cargo.toml
Normal file
12
crates/engine_window/Cargo.toml
Normal 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 }
|
|
@ -47,7 +47,6 @@ impl ApplicationHandler for WindowState {
|
|||
event_loop.exit();
|
||||
}
|
||||
WindowEvent::RedrawRequested => {
|
||||
log::debug!("The window was requested to be redrawn");
|
||||
if self.app.plugins_state() == PluginsState::Cleaned {
|
||||
self.app.update();
|
||||
}
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
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";
|
||||
RUST_LOG = "info,rust_vulkan_test=trace";
|
||||
RUST_LOG = "trace,rust_vulkan_test=trace";
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
pub mod camera;
|
||||
pub mod render;
|
||||
pub mod vulkan;
|
||||
pub mod window;
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
use bevy_app::App;
|
||||
|
||||
use crate::core::{
|
||||
vulkan,
|
||||
window::{self, config::WindowConfig},
|
||||
};
|
||||
|
||||
pub mod test_plugin;
|
||||
use engine_vulkan::VulkanPlugin;
|
||||
use engine_window::{WindowPlugin, config::WindowConfig};
|
||||
|
||||
pub fn init(app: &mut App) {
|
||||
let window_config = WindowConfig {
|
||||
|
@ -14,11 +9,7 @@ pub fn init(app: &mut App) {
|
|||
height: 600,
|
||||
};
|
||||
|
||||
app.add_plugins((
|
||||
test_plugin::TestPlugin,
|
||||
window::WindowPlugin { window_config },
|
||||
vulkan::VulkanPlugin,
|
||||
));
|
||||
app.add_plugins((WindowPlugin { window_config }, VulkanPlugin));
|
||||
// Window::new(app, window_config).unwrap();
|
||||
// Vulkan::new(app).unwrap();
|
||||
}
|
||||
|
|
|
@ -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!");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue