initial commit
This commit is contained in:
commit
82fa8cd257
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/target
|
||||
3255
Cargo.lock
generated
Normal file
3255
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
23
Cargo.toml
Normal file
23
Cargo.toml
Normal 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
31
src/ffi.rs
Normal 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
15
src/lib.rs
Normal 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 {}
|
||||
Loading…
Reference in a new issue