driver: remove new_spirv
method
This commit is contained in:
@@ -7,12 +7,15 @@
|
||||
//! with something that absorbs energy. since this example doesn't, it lets you see what
|
||||
//! happens when you just use the default boundary conditions.
|
||||
|
||||
use coremem::{mat, driver};
|
||||
use coremem::{mat, Driver};
|
||||
use coremem::geom::{Coord as _, Cube, Index};
|
||||
use coremem::units::Seconds;
|
||||
use coremem::sim::spirv::{self, SpirvSim};
|
||||
use coremem::stim::{Stimulus, TimeVarying as _, UniformStimulus};
|
||||
use coremem::types::vec::Vec3;
|
||||
|
||||
type Mat = mat::FullyGenericMaterial<f32>;
|
||||
|
||||
fn main() {
|
||||
coremem::init_logging();
|
||||
// create a 2d simulation with so many grid cells
|
||||
@@ -23,13 +26,12 @@ fn main() {
|
||||
let feature_size = 1e-6;
|
||||
|
||||
// create the simulation "driver".
|
||||
// by default all the computations are done with R32: a f32 which panics on NaN/Inf.
|
||||
// you can parameterize it to use R64, or unchecked f32 -- see src/driver.rs for definition.
|
||||
let mut driver: driver::SpirvDriver = driver::Driver::new_spirv(size, feature_size);
|
||||
|
||||
// uncomment to use the Spirv/GPU driver. this one is restricted to unchecked f32.
|
||||
// note: this won't have better perf unless you reduce the y4m/term renderer framerate below.
|
||||
// let mut driver: driver::SpirvDriver = driver::Driver::new_spirv(size, feature_size);
|
||||
// the first parameter is the float type to use: f32 for unchecked math, coremem::real::R32
|
||||
// to guard against NaN/Inf (useful for debugging).
|
||||
// to run this on the gpu instead of the gpu, replace `CpuBackend` with `WgpuBackend`.
|
||||
let mut driver = Driver::new_with_state(SpirvSim::<f32, Mat, spirv::CpuBackend>::new(
|
||||
size, feature_size
|
||||
));
|
||||
|
||||
// create a conductor on the left side.
|
||||
let conductor = Cube::new(
|
||||
|
Reference in New Issue
Block a user