initial commit

This commit is contained in:
janis 2026-03-23 11:21:48 +01:00
commit 82fa8cd257
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8
5 changed files with 3325 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

3255
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

23
Cargo.toml Normal file
View file

@ -0,0 +1,23 @@
[package]
name = "bevy_vulkan"
version = "0.1.0"
edition = "2024"
[dependencies]
bevy_ecs = "0.18.1"
bevy_app = "0.18.1"
bevy_tasks = "0.18.1"
bevy_utils = "0.18.1"
bevy_window = "0.18.1"
bevy_winit = "0.18.1"
bevy_platform = "0.18.1"
winit = "0.30"
raw-window-handle = "0.6"
thiserror = "2.0"
anyhow = "1.0.89"
ash = "0.38.0"
ash-window = "0.13.0"
vk-mem = "0.5.0"

31
src/ffi.rs Normal file
View file

@ -0,0 +1,31 @@
use core::marker::PhantomData;
use std::ffi::CStr;
/// A borrowed slice that can be safely sent across FFI boundaries.
#[repr(C)]
#[derive(Debug)]
pub struct Slice<'a, T> {
pub data: *const T,
pub len: usize,
pub _marker: PhantomData<&'a T>,
}
impl<'a, T> Slice<'a, T> {
/// Creates a new `Slice` from a Rust slice.
pub fn from_slice(slice: &'a [T]) -> Self {
Self {
data: slice.as_ptr(),
len: slice.len(),
_marker: PhantomData,
}
}
/// Casts the slice to a different type. The caller must ensure that the data is properly aligned and that the length is correct for the new type.
pub unsafe fn cast<U: Sized>(&self) -> Slice<'a, U> {
Slice {
data: self.data as *const U,
len: self.len,
_marker: PhantomData,
}
}
}

15
src/lib.rs Normal file
View file

@ -0,0 +1,15 @@
use bevy_app::Plugin;
#[derive(Debug)]
pub struct VulkanPlugin;
impl Plugin for VulkanPlugin {
fn build(&self, _app: &mut bevy_app::App) {
todo!()
}
}
mod ffi;
#[cfg(test)]
mod tests {}