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:
2020-12-16 14:04:30 -08:00
parent 737ae1b872
commit 41572f5285
4 changed files with 42 additions and 23 deletions

View File

@@ -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);