From 58ae38eca0af1f67adebef14967f00c6b6dbe174 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Sun, 30 Jun 2024 10:14:18 +0200 Subject: [PATCH] reduce number of draws & computes when only running tests --- benches/benches/computepass.rs | 6 ++++++ benches/benches/renderpass.rs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/benches/benches/computepass.rs b/benches/benches/computepass.rs index 6feea404ab4..eab86069c50 100644 --- a/benches/benches/computepass.rs +++ b/benches/benches/computepass.rs @@ -10,14 +10,20 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; use crate::DeviceState; +#[cfg(not(test))] const DISPATCH_COUNT: usize = 10_000; +#[cfg(test)] +const DISPATCH_COUNT: usize = 1; // Currently bindless is _much_ slower than with regularly resources, // since wgpu needs to issues barriers for all resources between each dispatch for all read/write textures & buffers. // This is in fact so slow that it makes the benchmark unusable when we use the same amount of // resources as the regular benchmark. // For details see https://github.com/gfx-rs/wgpu/issues/5766 +#[cfg(not(test))] const DISPATCH_COUNT_BINDLESS: usize = 1_000; +#[cfg(test)] +const DISPATCH_COUNT_BINDLESS: usize = 1; // Must match the number of textures in the computepass.wgsl shader const TEXTURES_PER_DISPATCH: usize = 2; diff --git a/benches/benches/renderpass.rs b/benches/benches/renderpass.rs index fcb35c38641..fcf661739aa 100644 --- a/benches/benches/renderpass.rs +++ b/benches/benches/renderpass.rs @@ -10,7 +10,12 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; use crate::DeviceState; +#[cfg(test)] +const DRAW_COUNT: usize = 1; + +#[cfg(not(test))] const DRAW_COUNT: usize = 10_000; + // Must match the number of textures in the renderpass.wgsl shader const TEXTURES_PER_DRAW: usize = 7; const VERTEX_BUFFERS_PER_DRAW: usize = 2;