Prepare benchmarks + ~1.7x prepare perf improvement (#121)
* Add prepare benchmarks * Skip unnecessary peaks * Cite sample sources
This commit is contained in:
parent
db2c1ca316
commit
28512c8630
8 changed files with 964 additions and 43 deletions
35
benches/state.rs
Normal file
35
benches/state.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
use pollster::block_on;
|
||||
|
||||
pub struct State {
|
||||
pub device: wgpu::Device,
|
||||
pub queue: wgpu::Queue,
|
||||
}
|
||||
|
||||
impl State {
|
||||
pub fn new() -> Self {
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends: wgpu::Backends::all(),
|
||||
flags: wgpu::InstanceFlags::empty(),
|
||||
dx12_shader_compiler: wgpu::Dx12Compiler::Fxc,
|
||||
gles_minor_version: wgpu::Gles3MinorVersion::Automatic,
|
||||
});
|
||||
|
||||
let adapter = block_on(wgpu::util::initialize_adapter_from_env_or_default(
|
||||
&instance, None,
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
let (device, queue) = block_on(adapter.request_device(
|
||||
&wgpu::DeviceDescriptor {
|
||||
label: Some("Benchmark Device"),
|
||||
required_features: adapter.features(),
|
||||
required_limits: adapter.limits(),
|
||||
memory_hints: wgpu::MemoryHints::Performance,
|
||||
},
|
||||
None,
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
Self { device, queue }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue