Skip to content

Commit 4548b57

Browse files
committed
reduce number of draws & computes when only running tests
1 parent a40d268 commit 4548b57

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

benches/benches/computepass.rs

+6
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator};
1010

1111
use crate::DeviceState;
1212

13+
#[cfg(not(test))]
1314
const DISPATCH_COUNT: usize = 10_000;
15+
#[cfg(test)]
16+
const DISPATCH_COUNT: usize = 8; // Running with up to 8 threads.
1417

1518
// Currently bindless is _much_ slower than with regularly resources,
1619
// since wgpu needs to issues barriers for all resources between each dispatch for all read/write textures & buffers.
1720
// This is in fact so slow that it makes the benchmark unusable when we use the same amount of
1821
// resources as the regular benchmark.
1922
// For details see https://github.com/gfx-rs/wgpu/issues/5766
23+
#[cfg(not(test))]
2024
const DISPATCH_COUNT_BINDLESS: usize = 1_000;
25+
#[cfg(test)]
26+
const DISPATCH_COUNT_BINDLESS: usize = 8; // Running with up to 8 threads.
2127

2228
// Must match the number of textures in the computepass.wgsl shader
2329
const TEXTURES_PER_DISPATCH: usize = 2;

benches/benches/renderpass.rs

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator};
1010

1111
use crate::DeviceState;
1212

13+
#[cfg(test)]
14+
const DRAW_COUNT: usize = 8; // Running with up to 8 threads.
15+
16+
#[cfg(not(test))]
1317
const DRAW_COUNT: usize = 10_000;
18+
1419
// Must match the number of textures in the renderpass.wgsl shader
1520
const TEXTURES_PER_DRAW: usize = 7;
1621
const VERTEX_BUFFERS_PER_DRAW: usize = 2;

0 commit comments

Comments
 (0)