mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-24 15:54:00 +00:00
refactor: vertex_index_common
: elide tests
alloc. w/ Itertools::cartesian_product
This commit is contained in:
parent
7600c61b72
commit
764b15a556
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -4384,6 +4384,7 @@ dependencies = [
|
||||
"env_logger",
|
||||
"futures-lite",
|
||||
"image",
|
||||
"itertools",
|
||||
"js-sys",
|
||||
"libtest-mimic",
|
||||
"log",
|
||||
|
@ -91,6 +91,7 @@ getrandom = "0.2"
|
||||
glam = "0.27"
|
||||
heck = "0.5.0"
|
||||
image = { version = "0.24", default-features = false, features = ["png"] }
|
||||
itertools = { version = "0.10.5" }
|
||||
ktx2 = "0.3"
|
||||
libc = "0.2"
|
||||
# libloading 0.8 switches from `winapi` to `windows-sys`; permit either
|
||||
|
@ -27,6 +27,7 @@ bytemuck.workspace = true
|
||||
cfg-if.workspace = true
|
||||
ctor.workspace = true
|
||||
futures-lite.workspace = true
|
||||
itertools.workspace = true
|
||||
libtest-mimic.workspace = true
|
||||
log.workspace = true
|
||||
parking_lot.workspace = true
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
use std::{num::NonZeroU64, ops::Range};
|
||||
|
||||
use itertools::Itertools;
|
||||
use strum::IntoEnumIterator;
|
||||
use wgpu::util::{BufferInitDescriptor, DeviceExt, RenderEncoder};
|
||||
|
||||
@ -337,30 +338,23 @@ async fn vertex_index_common(ctx: TestingContext) {
|
||||
)
|
||||
.create_view(&wgpu::TextureViewDescriptor::default());
|
||||
|
||||
let mut tests = Vec::with_capacity(
|
||||
TestCase::iter().count()
|
||||
* IdSource::iter().count()
|
||||
* DrawCallKind::iter().count()
|
||||
* EncoderKind::iter().count()
|
||||
* [false, true].iter().count(),
|
||||
);
|
||||
for case in TestCase::iter() {
|
||||
for id_source in IdSource::iter() {
|
||||
for draw_call_kind in DrawCallKind::iter() {
|
||||
for encoder_kind in EncoderKind::iter() {
|
||||
for vertex_pulling_transform in [false, true] {
|
||||
tests.push(Test {
|
||||
case,
|
||||
id_source,
|
||||
draw_call_kind,
|
||||
encoder_kind,
|
||||
vertex_pulling_transform,
|
||||
})
|
||||
}
|
||||
let tests = TestCase::iter()
|
||||
.cartesian_product(IdSource::iter())
|
||||
.cartesian_product(DrawCallKind::iter())
|
||||
.cartesian_product(EncoderKind::iter())
|
||||
.cartesian_product([false, true])
|
||||
.map(
|
||||
|((((case, id_source), draw_call_kind), encoder_kind), vertex_pulling_transform)| {
|
||||
Test {
|
||||
case,
|
||||
id_source,
|
||||
draw_call_kind,
|
||||
encoder_kind,
|
||||
vertex_pulling_transform,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let features = ctx.adapter.features();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user