mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-25 00:04:11 +00:00
Invert glam dependency (#641)
This commit is contained in:
parent
ba689b5603
commit
f3888d1bb3
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -394,7 +394,6 @@ dependencies = [
|
|||||||
name = "compiletests-deps-helper"
|
name = "compiletests-deps-helper"
|
||||||
version = "0.4.0-alpha.6"
|
version = "0.4.0-alpha.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glam",
|
|
||||||
"spirv-std",
|
"spirv-std",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1112,12 +1111,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glam"
|
name = "glam"
|
||||||
version = "0.14.0"
|
version = "0.15.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "333928d5eb103c5d4050533cec0384302db6be8ef7d3cebd30ec6a35350353da"
|
checksum = "3abb554f8ee44336b72d522e0a7fe86a29e09f839a36022fa869a7dfe941a54b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"spirv-std",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2272,7 +2270,6 @@ dependencies = [
|
|||||||
name = "shared"
|
name = "shared"
|
||||||
version = "0.4.0-alpha.6"
|
version = "0.4.0-alpha.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glam",
|
|
||||||
"spirv-std",
|
"spirv-std",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2351,6 +2348,7 @@ name = "spirv-std"
|
|||||||
version = "0.4.0-alpha.7"
|
version = "0.4.0-alpha.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
"glam",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"spirv-std-macros",
|
"spirv-std-macros",
|
||||||
"spirv-types",
|
"spirv-types",
|
||||||
|
@ -12,6 +12,7 @@ bitflags = "1.2.1"
|
|||||||
num-traits = { version = "0.2.14", default-features = false, features = ["libm"] }
|
num-traits = { version = "0.2.14", default-features = false, features = ["libm"] }
|
||||||
spirv-types = { path = "./shared", version = "0.4.0-alpha.3" }
|
spirv-types = { path = "./shared", version = "0.4.0-alpha.3" }
|
||||||
spirv-std-macros = { path = "./macros", version = "0.4.0-alpha.3" }
|
spirv-std-macros = { path = "./macros", version = "0.4.0-alpha.3" }
|
||||||
|
glam = { version = "0.15.2", default-features = false, features = ["libm"], optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
@ -103,6 +103,9 @@ pub use num_traits;
|
|||||||
pub use runtime_array::*;
|
pub use runtime_array::*;
|
||||||
pub use textures::*;
|
pub use textures::*;
|
||||||
|
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
pub use glam;
|
||||||
|
|
||||||
#[cfg(all(not(test), target_arch = "spirv"))]
|
#[cfg(all(not(test), target_arch = "spirv"))]
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
fn panic(_: &core::panic::PanicInfo<'_>) -> ! {
|
fn panic(_: &core::panic::PanicInfo<'_>) -> ! {
|
||||||
|
@ -1,2 +1,39 @@
|
|||||||
/// Abstract trait representing a SPIR-V vector type.
|
/// Abstract trait representing a SPIR-V vector type.
|
||||||
pub unsafe trait Vector<T: crate::scalar::Scalar, const N: usize>: Default {}
|
pub unsafe trait Vector<T: crate::scalar::Scalar, const N: usize>: Default {}
|
||||||
|
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<bool, 2> for glam::BVec2 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<bool, 3> for glam::BVec3 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<bool, 4> for glam::BVec4 {}
|
||||||
|
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f32, 2> for glam::Vec2 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f32, 3> for glam::Vec3 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f32, 3> for glam::Vec3A {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f32, 4> for glam::Vec4 {}
|
||||||
|
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f64, 2> for glam::DVec2 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f64, 3> for glam::DVec3 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<f64, 4> for glam::DVec4 {}
|
||||||
|
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<u32, 2> for glam::UVec2 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<u32, 3> for glam::UVec3 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<u32, 4> for glam::UVec4 {}
|
||||||
|
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<i32, 2> for glam::IVec2 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<i32, 3> for glam::IVec3 {}
|
||||||
|
#[cfg(feature = "glam")]
|
||||||
|
unsafe impl Vector<i32, 4> for glam::IVec4 {}
|
||||||
|
@ -9,4 +9,4 @@ license = "MIT OR Apache-2.0"
|
|||||||
crate-type = ["dylib"]
|
crate-type = ["dylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
spirv-std = { path = "../../../crates/spirv-std" }
|
spirv-std = { path = "../../../crates/spirv-std", features = ["glam"] }
|
||||||
|
@ -11,4 +11,4 @@ crate-type = ["dylib"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
shared = { path = "../../shaders/shared" }
|
shared = { path = "../../shaders/shared" }
|
||||||
spirv-std = { path = "../../../crates/spirv-std" }
|
spirv-std = { path = "../../../crates/spirv-std", features = ["glam"] }
|
||||||
|
@ -7,5 +7,4 @@ license = "MIT OR Apache-2.0"
|
|||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
spirv-std = { path = "../../../crates/spirv-std" }
|
spirv-std = { path = "../../../crates/spirv-std", features = ["glam"] }
|
||||||
glam = { version = "0.14", default-features = false, features = ["libm", "scalar-math", "spirv-std"] }
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
use core::f32::consts::PI;
|
use core::f32::consts::PI;
|
||||||
use glam::{vec3, Vec3};
|
use glam::{vec3, Vec3};
|
||||||
|
|
||||||
pub use glam;
|
pub use spirv_std::glam;
|
||||||
|
|
||||||
// Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but
|
// Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but
|
||||||
// we tie #[no_std] above to the same condition, so it's fine.
|
// we tie #[no_std] above to the same condition, so it's fine.
|
||||||
|
@ -10,5 +10,5 @@ publish = false
|
|||||||
crate-type = ["dylib"]
|
crate-type = ["dylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
spirv-std = { path = "../../../crates/spirv-std" }
|
spirv-std = { path = "../../../crates/spirv-std", features = ["glam"] }
|
||||||
shared = { path = "../shared" }
|
shared = { path = "../shared" }
|
||||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
|||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["dylib"]
|
crate-type = ["lib", "dylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
shared = { path = "../../shaders/shared" }
|
shared = { path = "../../shaders/shared" }
|
||||||
spirv-std = { path = "../../../crates/spirv-std" }
|
spirv-std = { path = "../../../crates/spirv-std", features = ["glam"] }
|
||||||
|
@ -8,9 +8,4 @@ license = "MIT OR Apache-2.0"
|
|||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
spirv-std = { path = "../../crates/spirv-std", features = ["const-generics"] }
|
spirv-std = { path = "../../crates/spirv-std", features = ["const-generics", "glam"] }
|
||||||
|
|
||||||
[dependencies.glam]
|
|
||||||
version = "0.14"
|
|
||||||
default-features = false
|
|
||||||
features = ["libm", "scalar-math", "spirv-std"]
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// build-pass
|
// build-pass
|
||||||
|
#![feature(lang_items)]
|
||||||
|
|
||||||
use glam::*;
|
use glam::*;
|
||||||
|
|
||||||
@ -46,3 +47,13 @@ pub fn main() {
|
|||||||
let v = Vec3::new(1.0, 1.0, 1.0);
|
let v = Vec3::new(1.0, 1.0, 1.0);
|
||||||
render(v, v, 1.0, 2.0);
|
render(v, v, 1.0, 2.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Figure out why these are needed and remove them (it should pick up the ones in spirv_std)
|
||||||
|
// https://github.com/EmbarkStudios/rust-gpu/issues/640
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic(_: &core::panic::PanicInfo<'_>) -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[lang = "eh_personality"]
|
||||||
|
extern "C" fn rust_eh_personality() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user