spirv: remove the ArrayHandleMut artifacts in Step{H,E}Context
this will make it easier to reuse these blocks on the CPU side.
This commit is contained in:
@@ -39,8 +39,10 @@ fn step_h<R: Real, M: Material<R>>(
|
||||
) {
|
||||
if id.x() < meta.dim.x() && id.y() < meta.dim.y() && id.z() < meta.dim.z() {
|
||||
let sim_state = SerializedStepH::new(meta, stimulus_h, material, e, h, m);
|
||||
let update_state = sim_state.index(id);
|
||||
update_state.step_h();
|
||||
let (update_state, mut out_h, mut out_m) = sim_state.index(id);
|
||||
let (new_h, new_m) = update_state.step_h();
|
||||
out_h.write(new_h);
|
||||
out_m.write(new_m);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +57,9 @@ fn step_e<R: Real, M: Material<R>>(
|
||||
if id.x() < meta.dim.x() && id.y() < meta.dim.y() && id.z() < meta.dim.z() {
|
||||
let sim_state = SerializedStepE::new(meta, stimulus_e, material, e, h);
|
||||
|
||||
let update_state = sim_state.index(id);
|
||||
update_state.step_e();
|
||||
let (update_state, mut out_e) = sim_state.index(id);
|
||||
let new_e = update_state.step_e();
|
||||
out_e.write(new_e);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user