Optimize GenericMaterial layout
Shaving off 2 floats, i.e. 16 bytes. Brings a 3-4% overall perf increase. Should be possible to shave another 16 bytes.
This commit is contained in:
@@ -100,7 +100,7 @@ fn main() {
|
||||
let d = Vec2::new(to_m(x_px), to_m(y_px)) - center;
|
||||
let r = d.mag();
|
||||
if (conductor_inner_rad as _..conductor_outer_rad as _).contains(&r) {
|
||||
*driver.state.get_mut(loc).mat_mut() = mat::Static::conductor(conductivity).into();
|
||||
*driver.state.get_mut(loc).mat_mut() = mat::db::conductor(conductivity).into();
|
||||
} else if (ferro_inner_rad as _..ferro_outer_rad as _).contains(&r) {
|
||||
let half_depth_px = from_m(half_depth);
|
||||
let ferro_depth_px = from_m(ferro_depth);
|
||||
|
Reference in New Issue
Block a user