spirv: instantiate the backend in mod.rs, not gpu.rs
This commit is contained in:
@@ -2,7 +2,6 @@ use futures::FutureExt as _;
|
||||
use log::{info, warn};
|
||||
use std::borrow::Cow;
|
||||
use std::num::NonZeroU64;
|
||||
use std::sync::Arc;
|
||||
use wgpu;
|
||||
use wgpu::util::DeviceExt as _;
|
||||
|
||||
@@ -73,9 +72,6 @@ where
|
||||
|
||||
let sim_meta = [self.meta.clone()];
|
||||
|
||||
self.wgpu.get_or_insert_with(
|
||||
|| Arc::new(WgpuData::new::<M>(size.volume()))
|
||||
);
|
||||
let wgpu = &**self.wgpu.as_ref().unwrap();
|
||||
let device = &wgpu.device;
|
||||
let queue = &wgpu.queue;
|
||||
|
@@ -93,6 +93,10 @@ where
|
||||
M: Send + Sync + Material<f32> + 'static
|
||||
{
|
||||
fn step_multiple<S: AbstractStimulus>(&mut self, num_steps: u32, s: &S) {
|
||||
let vol = self.size().volume();
|
||||
self.wgpu.get_or_insert_with(
|
||||
|| Arc::new(WgpuData::new::<M>(vol))
|
||||
);
|
||||
self.step_spirv(num_steps, s);
|
||||
self.step_no += num_steps as u64;
|
||||
}
|
||||
|
Reference in New Issue
Block a user