spirv: migrate Material trait to types, and parameterize by R

This commit is contained in:
2022-07-18 14:33:09 -07:00
parent 35251f5a7f
commit 7d2a3baadc
7 changed files with 38 additions and 34 deletions

View File

@@ -19,8 +19,9 @@ pub mod support;
pub use sim::{SerializedSimMeta, SerializedStepE, SerializedStepH};
pub use support::{Optional, UnsizedArray};
use mat::{IsoConductorOr, Ferroxcube3R1MH, FullyGenericMaterial, Material};
use mat::{IsoConductorOr, Ferroxcube3R1MH, FullyGenericMaterial};
use coremem_types::mat::Material;
use coremem_types::vec::{Vec3, Vec3u};
type Iso3R1 = IsoConductorOr<Ferroxcube3R1MH>;
@@ -29,7 +30,7 @@ fn glam_vec_to_internal(v: glam::UVec3) -> Vec3u {
Vec3u::new(v.x, v.y, v.z)
}
fn step_h<M: Material>(
fn step_h<M: Material<f32>>(
id: Vec3u,
meta: &SerializedSimMeta,
stimulus_h: &UnsizedArray<Vec3<f32>>,
@@ -45,7 +46,7 @@ fn step_h<M: Material>(
}
}
fn step_e<M: Material>(
fn step_e<M: Material<f32>>(
id: Vec3u,
meta: &SerializedSimMeta,
stimulus_e: &UnsizedArray<Vec3<f32>>,