From f8d47dc24a06ab5de26c5adbd4b29f4301eb9252 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Thu, 13 Apr 2017 23:28:26 -0700 Subject: [PATCH] Fixed some things for building with SIMD support. --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- src/float4.rs | 4 ++-- src/surface/mod.rs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ec1de3..8b64f01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = "0.1.0" dependencies = [ "clap 2.23.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "lodepng 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "mem_arena 0.1.0", "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -12,7 +12,7 @@ dependencies = [ "openexr 0.1.0 (git+https://github.com/cessen/openexr-rs?rev=612fc6c81c031970ffddcab15509236711613de8)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "simd 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -85,7 +85,7 @@ dependencies = [ [[package]] name = "lazy_static" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -167,7 +167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "simd" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -231,7 +231,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97" "checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2f61b8421c7a4648c391611625d56fdd5c7567da05af1be655fd8cacc643abb3" +"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" "checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135" "checksum lodepng 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2949340106c6ddacb872a8bceb940e39e332739873d56c1315917778527f8779" "checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" @@ -243,7 +243,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rgb 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4db5350eea2dbb4f4972c4fb4d980b70c3f0ed3983eb2f66d174a43457514a14" "checksum rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "684ce48436d6465300c9ea783b6b14c4361d6b8dcbb1375b486a69cc19e2dfb0" "checksum scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3ef399c8893e8cb7aa9696e895427fab3a6bf265977bb96e126f24ddd2cda85a" -"checksum simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5847c2d766ca7ce7227672850955802fabd779ba616aeabead4c2c3877023" +"checksum simd 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a94d14a2ae1f1f110937de5fb69e494372560181c7e1739a097fcc2cee37ba0" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" "checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" diff --git a/Cargo.toml b/Cargo.toml index 0297af8..78352f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ crossbeam = "0.2" num_cpus = "1.0" lodepng = "0.8" lazy_static = "0.2" -simd = { version = "0.1.1", optional = true } +simd = { version = "0.2.0", optional = true } # Github dependencies openexr = { git = "https://github.com/cessen/openexr-rs", rev = "612fc6c81c031970ffddcab15509236711613de8" } diff --git a/src/float4.rs b/src/float4.rs index b340034..42c64d0 100644 --- a/src/float4.rs +++ b/src/float4.rs @@ -150,7 +150,7 @@ impl Float4 { #[cfg(feature = "simd_perf")] pub fn lte(&self, other: Float4) -> Bool4 { - Bool4 { data: self.data.lte(other.data) } + Bool4 { data: self.data.le(other.data) } } #[cfg(not(feature = "simd_perf"))] pub fn lte(&self, other: Float4) -> Bool4 { @@ -178,7 +178,7 @@ impl Float4 { #[cfg(feature = "simd_perf")] pub fn gte(&self, other: Float4) -> Bool4 { - Bool4 { data: self.data.gte(other.data) } + Bool4 { data: self.data.ge(other.data) } } #[cfg(not(feature = "simd_perf"))] pub fn gte(&self, other: Float4) -> Bool4 { diff --git a/src/surface/mod.rs b/src/surface/mod.rs index 259a79a..7af04e7 100644 --- a/src/surface/mod.rs +++ b/src/surface/mod.rs @@ -34,10 +34,10 @@ pub enum SurfaceIntersection { #[derive(Debug, Copy, Clone)] pub struct SurfaceIntersectionData { pub incoming: Vector, // Direction of the incoming ray - pub t: f32, // Ray t-value at the intersection point pub pos: Point, // Position of the intersection pub nor: Normal, // Shading normal pub nor_g: Normal, // True geometric normal - pub uv: (f32, f32), // 2d surface parameters pub local_space: Matrix4x4, // Matrix from global space to local space + pub t: f32, // Ray t-value at the intersection point + pub uv: (f32, f32), // 2d surface parameters }