File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ pub mod vector {
91
91
RngT ( z0, z1, z2, z3)
92
92
}
93
93
94
- #[ inline]
94
+ #[ inline( always ) ]
95
95
pub fn gen_u32 ( & mut self ) -> u32xN {
96
96
let mut b = ( ( self . 0 << 6 ) ^ self . 0 ) >> 13 ;
97
97
self . 0 = ( ( self . 0 & u32xN:: splat ( 4_294_967_294 ) ) << 18 ) ^ b;
@@ -104,7 +104,7 @@ pub mod vector {
104
104
self . 0 ^ self . 1 ^ self . 2 ^ self . 3
105
105
}
106
106
107
- #[ inline]
107
+ #[ inline( always ) ]
108
108
pub fn gen ( & mut self ) -> f32xN {
109
109
let mut v = self . gen_u32 ( ) ;
110
110
v &= u32xN:: splat ( ( 1_u32 << 23 ) - 1 ) ;
@@ -121,7 +121,7 @@ pub mod vector {
121
121
}
122
122
123
123
impl RngH {
124
- #[ inline]
124
+ #[ inline( always ) ]
125
125
pub fn gen ( & mut self ) -> f32xN {
126
126
unsafe { ( * self . rng . get ( ) ) . gen ( ) }
127
127
}
Original file line number Diff line number Diff line change @@ -55,15 +55,19 @@ impl Default for Random {
55
55
56
56
impl Scene for Random {
57
57
const NAO_SAMPLES : usize = 8 ;
58
+ #[ inline( always) ]
58
59
fn rand ( & mut self ) -> f32 {
59
60
:: random:: scalar:: thread_rng ( ) . gen ( )
60
61
}
62
+ #[ inline( always) ]
61
63
fn plane ( & self ) -> & Plane {
62
64
& self . plane
63
65
}
66
+ #[ inline( always) ]
64
67
fn spheres ( & self ) -> & [ Sphere ] {
65
68
& self . spheres
66
69
}
70
+ #[ inline( always) ]
67
71
fn rand_f32xN ( & mut self ) -> ( f32xN , f32xN ) {
68
72
let mut rng = :: random:: vector:: thread_rng ( ) ;
69
73
( rng. gen ( ) , rng. gen ( ) )
You can’t perform that action at this time.
0 commit comments