Better path usage and "extern crate" removal in sub-crates.
This commit is contained in:
parent
28a07de456
commit
508cda6021
|
@ -1,9 +1,6 @@
|
|||
// Generate table for traversal order of quad BVHs.
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::{env, fs::File, io::Write, path::Path};
|
||||
|
||||
fn main() {
|
||||
// Build the traversal table.
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::{env, fs::File, io::Write, path::Path};
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct Chromaticities {
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
/// Implementation of Float4 for x86_64 platforms with SSE support.
|
||||
#[cfg(all(target_arch = "x86_64", target_feature = "sse"))]
|
||||
mod x86_64_sse {
|
||||
use std::arch::x86_64::__m128;
|
||||
use std::cmp::PartialEq;
|
||||
use std::ops::{Add, AddAssign, BitAnd, BitOr, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
|
||||
use std::{
|
||||
arch::x86_64::__m128,
|
||||
cmp::PartialEq,
|
||||
ops::{Add, AddAssign, BitAnd, BitOr, Div, DivAssign, Mul, MulAssign, Sub, SubAssign},
|
||||
};
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct Float4 {
|
||||
|
@ -626,8 +628,10 @@ mod x86_64_sse {
|
|||
/// Implementation fo Float4 for any platform, foregoing any
|
||||
/// platform-specific optimizations.
|
||||
mod fallback {
|
||||
use std::cmp::PartialEq;
|
||||
use std::ops::{Add, AddAssign, BitAnd, BitOr, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
|
||||
use std::{
|
||||
cmp::PartialEq,
|
||||
ops::{Add, AddAssign, BitAnd, BitOr, Div, DivAssign, Mul, MulAssign, Sub, SubAssign},
|
||||
};
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct Float4 {
|
||||
|
|
|
@ -22,10 +22,7 @@
|
|||
|
||||
// Generate Rust code for evaluating Halton points with Faure-permutations for different bases.
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::{env, fs::File, io::Write, path::Path};
|
||||
|
||||
/// How many components to generate.
|
||||
const NUM_DIMENSIONS: usize = 128;
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
extern crate float4;
|
||||
|
||||
mod matrix;
|
||||
mod normal;
|
||||
mod point;
|
||||
mod vector;
|
||||
|
||||
pub use self::matrix::Matrix4x4;
|
||||
pub use self::normal::Normal;
|
||||
pub use self::point::Point;
|
||||
pub use self::vector::Vector;
|
||||
pub use self::{matrix::Matrix4x4, normal::Normal, point::Point, vector::Vector};
|
||||
|
||||
/// Trait for calculating dot products.
|
||||
pub trait DotProduct {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use std;
|
||||
use std::ops::{Index, IndexMut, Mul};
|
||||
|
||||
use float4::{invert, transpose, Float4};
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use std::cmp::PartialEq;
|
||||
use std::ops::{Add, Div, Mul, Neg, Sub};
|
||||
use std::{
|
||||
cmp::PartialEq,
|
||||
ops::{Add, Div, Mul, Neg, Sub},
|
||||
};
|
||||
|
||||
use float4::Float4;
|
||||
|
||||
use super::{CrossProduct, DotProduct};
|
||||
use super::{Matrix4x4, Vector};
|
||||
use super::{CrossProduct, DotProduct, Matrix4x4, Vector};
|
||||
|
||||
/// A surface normal in 3d homogeneous space.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use std::cmp::PartialEq;
|
||||
use std::ops::{Add, Mul, Sub};
|
||||
use std::{
|
||||
cmp::PartialEq,
|
||||
ops::{Add, Mul, Sub},
|
||||
};
|
||||
|
||||
use float4::Float4;
|
||||
|
||||
use super::Matrix4x4;
|
||||
use super::Vector;
|
||||
use super::{Matrix4x4, Vector};
|
||||
|
||||
/// A position in 3d homogeneous space.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use std::cmp::PartialEq;
|
||||
use std::ops::{Add, Div, Mul, Neg, Sub};
|
||||
use std::{
|
||||
cmp::PartialEq,
|
||||
ops::{Add, Div, Mul, Neg, Sub},
|
||||
};
|
||||
|
||||
use float4::Float4;
|
||||
|
||||
use super::{CrossProduct, DotProduct};
|
||||
use super::{Matrix4x4, Normal, Point};
|
||||
use super::{CrossProduct, DotProduct, Matrix4x4, Normal, Point};
|
||||
|
||||
/// A direction vector in 3d homogeneous space.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
#![allow(clippy::needless_return)]
|
||||
#![allow(clippy::mut_from_ref)]
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::cmp::max;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::slice;
|
||||
use std::{
|
||||
cell::{Cell, RefCell},
|
||||
cmp::max,
|
||||
mem::{align_of, size_of},
|
||||
slice,
|
||||
};
|
||||
|
||||
const GROWTH_FRACTION: usize = 8; // 1/N (smaller number leads to bigger allocations)
|
||||
const DEFAULT_MIN_BLOCK_SIZE: usize = 1 << 10; // 1 KiB
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
#[macro_use]
|
||||
extern crate bencher;
|
||||
extern crate oct32norm;
|
||||
extern crate rand;
|
||||
|
||||
use bencher::{black_box, Bencher};
|
||||
use bencher::{benchmark_group, benchmark_main, black_box, Bencher};
|
||||
use oct32norm::{decode, encode};
|
||||
use rand::{rngs::SmallRng, FromEntropy, Rng};
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
|
||||
mod matrices;
|
||||
|
||||
pub use crate::matrices::NUM_DIMENSIONS;
|
||||
use crate::matrices::{MATRICES, SIZE};
|
||||
pub use crate::matrices::{MATRICES, NUM_DIMENSIONS, SIZE};
|
||||
|
||||
/// Compute one component of the Sobol'-sequence, where the component
|
||||
/// corresponds to the dimension parameter, and the index specifies
|
||||
|
|
|
@ -4,10 +4,9 @@
|
|||
#![allow(clippy::useless_let_if_seq)]
|
||||
#![allow(clippy::cyclomatic_complexity)]
|
||||
|
||||
extern crate float4;
|
||||
use std::f32;
|
||||
|
||||
use float4::Float4;
|
||||
use std::f32;
|
||||
|
||||
mod spectra_tables;
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
#[macro_use]
|
||||
extern crate bencher;
|
||||
extern crate rand;
|
||||
extern crate trifloat;
|
||||
|
||||
use bencher::{black_box, Bencher};
|
||||
use bencher::{benchmark_group, benchmark_main, black_box, Bencher};
|
||||
use rand::{rngs::SmallRng, FromEntropy, Rng};
|
||||
use trifloat::{decode, encode};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user