From 3e153fb8eca178f6df76c253d0998d48bc061a03 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Mon, 14 Jul 2025 00:27:13 -0400 Subject: [PATCH] Label no-op supporting tests --- naga/tests/naga/example_wgsl.rs | 2 +- naga/tests/naga/snapshots.rs | 9 +- player/tests/player/main.rs | 2 +- tests/tests/wgpu-compile/main.rs | 1 + .../tests/wgpu-gpu/bind_group_layout_dedup.rs | 36 +++- tests/tests/wgpu-gpu/bind_groups.rs | 11 +- tests/tests/wgpu-gpu/buffer.rs | 122 ++++++------- tests/tests/wgpu-gpu/buffer_copy.rs | 88 +++++----- tests/tests/wgpu-gpu/buffer_usages.rs | 34 ++-- tests/tests/wgpu-gpu/cloneable_types.rs | 7 +- .../tests/wgpu-gpu/compute_pass_ownership.rs | 6 +- tests/tests/wgpu-gpu/device.rs | 24 ++- .../wgpu-gpu/dispatch_workgroups_indirect.rs | 5 +- tests/tests/wgpu-gpu/draw_indirect.rs | 14 +- tests/tests/wgpu-gpu/dual_source_blending.rs | 8 +- tests/tests/wgpu-gpu/encoder.rs | 36 ++-- tests/tests/wgpu-gpu/float32_filterable.rs | 8 +- tests/tests/wgpu-gpu/image_atomics/mod.rs | 4 +- tests/tests/wgpu-gpu/instance.rs | 6 +- tests/tests/wgpu-gpu/life_cycle.rs | 18 +- tests/tests/wgpu-gpu/mem_leaks.rs | 3 +- tests/tests/wgpu-gpu/nv12_texture/mod.rs | 30 +++- tests/tests/wgpu-gpu/pipeline.rs | 18 +- tests/tests/wgpu-gpu/poll.rs | 42 +++-- tests/tests/wgpu-gpu/query_set.rs | 2 +- tests/tests/wgpu-gpu/queue_transfer.rs | 8 +- tests/tests/wgpu-gpu/ray_tracing/as_build.rs | 27 ++- tests/tests/wgpu-gpu/ray_tracing/as_create.rs | 6 +- tests/tests/wgpu-gpu/ray_tracing/limits.rs | 3 +- tests/tests/wgpu-gpu/ray_tracing/scene/mod.rs | 6 +- tests/tests/wgpu-gpu/regression/issue_3457.rs | 7 +- tests/tests/wgpu-gpu/regression/issue_4024.rs | 3 +- tests/tests/wgpu-gpu/regression/issue_4122.rs | 2 +- tests/tests/wgpu-gpu/regression/issue_4485.rs | 2 +- tests/tests/wgpu-gpu/regression/issue_4514.rs | 2 +- tests/tests/wgpu-gpu/regression/issue_5553.rs | 7 +- tests/tests/wgpu-gpu/regression/issue_6317.rs | 3 +- tests/tests/wgpu-gpu/regression/issue_6467.rs | 6 +- tests/tests/wgpu-gpu/render_pass_ownership.rs | 6 +- .../wgpu-gpu/resource_descriptor_accessor.rs | 30 ++-- tests/tests/wgpu-gpu/resource_error.rs | 124 ++++++------- tests/tests/wgpu-gpu/samplers.rs | 10 +- .../shader/compilation_messages/mod.rs | 4 +- tests/tests/wgpu-gpu/texture_binding/mod.rs | 3 +- tests/tests/wgpu-gpu/texture_blit.rs | 4 +- tests/tests/wgpu-gpu/texture_bounds.rs | 164 +++++++++--------- tests/tests/wgpu-gpu/texture_view_creation.rs | 14 +- tests/tests/wgpu-gpu/transfer.rs | 130 +++++++------- tests/tests/wgpu-gpu/transition_resources.rs | 66 +++---- tests/tests/wgpu-gpu/write_texture.rs | 7 +- 50 files changed, 683 insertions(+), 497 deletions(-) diff --git a/naga/tests/naga/example_wgsl.rs b/naga/tests/naga/example_wgsl.rs index d9c642a1c..2e1062d7b 100644 --- a/naga/tests/naga/example_wgsl.rs +++ b/naga/tests/naga/example_wgsl.rs @@ -6,7 +6,7 @@ use std::{ffi::OsStr, fs, path::Path}; /// Runs through all example shaders and ensures they are valid wgsl. // While we _can_ run this test under miri, it is extremely slow (>5 minutes), // and naga isn't the primary target for miri testing, so we disable it. -#[cfg(not(miri))] +#[cfg_attr(miri, ignore)] #[test] pub fn parse_example_wgsl() { let example_path = Path::new(env!("CARGO_MANIFEST_DIR")) diff --git a/naga/tests/naga/snapshots.rs b/naga/tests/naga/snapshots.rs index 37a068d27..e2288eee9 100644 --- a/naga/tests/naga/snapshots.rs +++ b/naga/tests/naga/snapshots.rs @@ -820,7 +820,8 @@ fn write_output_wgsl( // While we _can_ run this test under miri, it is extremely slow (>5 minutes), // and naga isn't the primary target for miri testing, so we disable it. -#[cfg(all(feature = "wgsl-in", not(miri)))] +#[cfg(feature = "wgsl-in")] +#[cfg_attr(miri, ignore)] #[test] fn convert_snapshots_wgsl() { let _ = env_logger::try_init(); @@ -846,7 +847,8 @@ fn convert_snapshots_wgsl() { } // miri doesn't allow us to shell out to `spirv-as` -#[cfg(all(feature = "spv-in", not(miri)))] +#[cfg(feature = "spv-in")] +#[cfg_attr(miri, ignore)] #[test] fn convert_snapshots_spv() { use std::process::Command; @@ -897,7 +899,8 @@ fn convert_snapshots_spv() { // While we _can_ run this test under miri, it is extremely slow (>5 minutes), // and naga isn't the primary target for miri testing, so we disable it. -#[cfg(all(feature = "glsl-in", not(miri)))] +#[cfg(feature = "glsl-in")] +#[cfg_attr(miri, ignore)] #[allow(unused_variables)] #[test] fn convert_snapshots_glsl() { diff --git a/player/tests/player/main.rs b/player/tests/player/main.rs index ca0e728ae..1e16c3f03 100644 --- a/player/tests/player/main.rs +++ b/player/tests/player/main.rs @@ -245,7 +245,7 @@ impl Corpus { } } -#[cfg(not(miri))] +#[cfg_attr(miri, ignore)] #[test] fn test_api() { env_logger::init(); diff --git a/tests/tests/wgpu-compile/main.rs b/tests/tests/wgpu-compile/main.rs index e435171c4..a5edfa73b 100644 --- a/tests/tests/wgpu-compile/main.rs +++ b/tests/tests/wgpu-compile/main.rs @@ -1,6 +1,7 @@ #![cfg(not(miri))] // Tests that ensure that various constructs that should not compile do not compile. +#[cfg_attr(miri, ignore)] #[test] fn compile_fail() { let t = trybuild::TestCases::new(); diff --git a/tests/tests/wgpu-gpu/bind_group_layout_dedup.rs b/tests/tests/wgpu-gpu/bind_group_layout_dedup.rs index 3164367f8..ee91b907b 100644 --- a/tests/tests/wgpu-gpu/bind_group_layout_dedup.rs +++ b/tests/tests/wgpu-gpu/bind_group_layout_dedup.rs @@ -40,7 +40,11 @@ const ENTRY: wgpu::BindGroupLayoutEntry = wgpu::BindGroupLayoutEntry { #[gpu_test] static BIND_GROUP_LAYOUT_DEDUPLICATION: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_async(bgl_dedupe); async fn bgl_dedupe(ctx: TestingContext) { @@ -120,7 +124,11 @@ async fn bgl_dedupe(ctx: TestingContext) { #[gpu_test] static BIND_GROUP_LAYOUT_DEDUPLICATION_WITH_DROPPED_USER_HANDLE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(bgl_dedupe_with_dropped_user_handle); // https://github.com/gfx-rs/wgpu/issues/4824 @@ -203,7 +211,11 @@ fn bgl_dedupe_with_dropped_user_handle(ctx: TestingContext) { #[gpu_test] static GET_DERIVED_BGL: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(get_derived_bgl); fn get_derived_bgl(ctx: TestingContext) { @@ -277,7 +289,11 @@ fn get_derived_bgl(ctx: TestingContext) { #[gpu_test] static SEPARATE_PIPELINES_HAVE_INCOMPATIBLE_DERIVED_BGLS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(separate_pipelines_have_incompatible_derived_bgls); fn separate_pipelines_have_incompatible_derived_bgls(ctx: TestingContext) { @@ -341,7 +357,11 @@ fn separate_pipelines_have_incompatible_derived_bgls(ctx: TestingContext) { #[gpu_test] static DERIVED_BGLS_INCOMPATIBLE_WITH_REGULAR_BGLS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(derived_bgls_incompatible_with_regular_bgls); fn derived_bgls_incompatible_with_regular_bgls(ctx: TestingContext) { @@ -412,7 +432,11 @@ fn derived_bgls_incompatible_with_regular_bgls(ctx: TestingContext) { #[gpu_test] static BIND_GROUP_LAYOUT_DEDUPLICATION_DERIVED: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(bgl_dedupe_derived); fn bgl_dedupe_derived(ctx: TestingContext) { diff --git a/tests/tests/wgpu-gpu/bind_groups.rs b/tests/tests/wgpu-gpu/bind_groups.rs index f01d8010f..c8b0acad5 100644 --- a/tests/tests/wgpu-gpu/bind_groups.rs +++ b/tests/tests/wgpu-gpu/bind_groups.rs @@ -176,14 +176,15 @@ static MULTIPLE_BINDINGS_WITH_DIFFERENT_SIZES: GpuTestConfiguration = GpuTestCon .parameters( TestParameters::default() .limits(wgpu::Limits::downlevel_defaults()) - .expect_fail(FailureCase::always()), // https://github.com/gfx-rs/wgpu/issues/7359 + .expect_fail(FailureCase::always()) + .enable_noop(), // https://github.com/gfx-rs/wgpu/issues/7359 ) .run_sync(multiple_bindings_with_differing_sizes); #[gpu_test] static BIND_GROUP_NONFILTERING_LAYOUT_NONFILTERING_SAMPLER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { try_sampler_nonfiltering_layout( ctx, @@ -201,7 +202,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_NONFILTERING_SAMPLER: GpuTestConfiguration #[gpu_test] static BIND_GROUP_NONFILTERING_LAYOUT_MIN_SAMPLER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { try_sampler_nonfiltering_layout( ctx, @@ -219,7 +220,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_MIN_SAMPLER: GpuTestConfiguration = #[gpu_test] static BIND_GROUP_NONFILTERING_LAYOUT_MAG_SAMPLER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { try_sampler_nonfiltering_layout( ctx, @@ -237,7 +238,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_MAG_SAMPLER: GpuTestConfiguration = #[gpu_test] static BIND_GROUP_NONFILTERING_LAYOUT_MIPMAP_SAMPLER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { try_sampler_nonfiltering_layout( ctx, diff --git a/tests/tests/wgpu-gpu/buffer.rs b/tests/tests/wgpu-gpu/buffer.rs index 899270845..3ae848ed5 100644 --- a/tests/tests/wgpu-gpu/buffer.rs +++ b/tests/tests/wgpu-gpu/buffer.rs @@ -95,78 +95,84 @@ async fn test_empty_buffer_range(ctx: &TestingContext, buffer_size: u64, label: #[gpu_test] static EMPTY_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().expect_fail(FailureCase::always())) + .parameters( + TestParameters::default() + .expect_fail(FailureCase::always()) + .enable_noop(), + ) .run_async(|ctx| async move { test_empty_buffer_range(&ctx, 2048, "regular buffer").await; test_empty_buffer_range(&ctx, 0, "zero-sized buffer").await; }); #[gpu_test] -static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new().run_async(|ctx| async move { - // This test writes 16 bytes at the beginning of buffer mapped mapped with - // an offset of 32 bytes. Then the buffer is copied into another buffer that - // is read back and we check that the written bytes are correctly placed at - // offset 32..48. - // The goal is to check that get_mapped_range did not accidentally double-count - // the mapped offset. +static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { + // This test writes 16 bytes at the beginning of buffer mapped mapped with + // an offset of 32 bytes. Then the buffer is copied into another buffer that + // is read back and we check that the written bytes are correctly placed at + // offset 32..48. + // The goal is to check that get_mapped_range did not accidentally double-count + // the mapped offset. - let write_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor { - label: None, - size: 256, - usage: wgpu::BufferUsages::MAP_WRITE | wgpu::BufferUsages::COPY_SRC, - mapped_at_creation: false, - }); - let read_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor { - label: None, - size: 256, - usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST, - mapped_at_creation: false, - }); - - write_buf - .slice(32..) - .map_async(wgpu::MapMode::Write, move |result| { - result.unwrap(); + let write_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor { + label: None, + size: 256, + usage: wgpu::BufferUsages::MAP_WRITE | wgpu::BufferUsages::COPY_SRC, + mapped_at_creation: false, + }); + let read_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor { + label: None, + size: 256, + usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST, + mapped_at_creation: false, }); - ctx.async_poll(wgpu::PollType::wait()).await.unwrap(); + write_buf + .slice(32..) + .map_async(wgpu::MapMode::Write, move |result| { + result.unwrap(); + }); - { - let slice = write_buf.slice(32..48); - let mut view = slice.get_mapped_range_mut(); - for byte in &mut view[..] { - *byte = 2; + ctx.async_poll(wgpu::PollType::wait()).await.unwrap(); + + { + let slice = write_buf.slice(32..48); + let mut view = slice.get_mapped_range_mut(); + for byte in &mut view[..] { + *byte = 2; + } } - } - write_buf.unmap(); + write_buf.unmap(); - let mut encoder = ctx - .device - .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); + let mut encoder = ctx + .device + .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); - encoder.copy_buffer_to_buffer(&write_buf, 0, &read_buf, 0, 256); + encoder.copy_buffer_to_buffer(&write_buf, 0, &read_buf, 0, 256); - ctx.queue.submit(Some(encoder.finish())); + ctx.queue.submit(Some(encoder.finish())); - read_buf - .slice(..) - .map_async(wgpu::MapMode::Read, Result::unwrap); + read_buf + .slice(..) + .map_async(wgpu::MapMode::Read, Result::unwrap); - ctx.async_poll(wgpu::PollType::wait()).await.unwrap(); + ctx.async_poll(wgpu::PollType::wait()).await.unwrap(); - let slice = read_buf.slice(..); - let view = slice.get_mapped_range(); - for byte in &view[0..32] { - assert_eq!(*byte, 0); - } - for byte in &view[32..48] { - assert_eq!(*byte, 2); - } - for byte in &view[48..] { - assert_eq!(*byte, 0); - } -}); + let slice = read_buf.slice(..); + let view = slice.get_mapped_range(); + for byte in &view[0..32] { + assert_eq!(*byte, 0); + } + for byte in &view[32..48] { + assert_eq!(*byte, 2); + } + for byte in &view[48..] { + assert_eq!(*byte, 0); + } + }); /// The WebGPU algorithm [validating shader binding][vsb] requires /// implementations to check that buffer bindings are large enough to @@ -177,7 +183,7 @@ static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new().run_async( /// 16 for that variable's group/index. Pipeline creation should fail. #[gpu_test] static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters(TestParameters::default().test_features_limits().enable_noop()) .run_sync(|ctx| { // Create a shader module that statically uses a storage buffer. let shader_module = ctx @@ -247,7 +253,7 @@ static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT: GpuTestConfiguration = GpuTestConfigu /// binding. Command recording should fail. #[gpu_test] static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters(TestParameters::default().test_features_limits().enable_noop()) .run_sync(|ctx| { // This test tries to use a bindgroup layout with a // min_binding_size of 16 to an index whose WGSL type requires 32 @@ -344,7 +350,7 @@ static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH: GpuTestConfiguration = GpuTestConfi #[gpu_test] static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let size = 16; @@ -370,7 +376,7 @@ static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfi #[gpu_test] static CLEAR_OFFSET_PLUS_SIZE_OUTSIDE_U64_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor { label: None, diff --git a/tests/tests/wgpu-gpu/buffer_copy.rs b/tests/tests/wgpu-gpu/buffer_copy.rs index e5d3851a4..a3091d216 100644 --- a/tests/tests/wgpu-gpu/buffer_copy.rs +++ b/tests/tests/wgpu-gpu/buffer_copy.rs @@ -2,7 +2,7 @@ use wgpu::BufferAddress; -use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.push(COPY_ALIGNMENT); @@ -26,49 +26,51 @@ fn try_copy( } #[gpu_test] -static COPY_ALIGNMENT: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - try_copy(&ctx, 0, 0, None); - try_copy( - &ctx, - 4, - 16 + 1, - Some("copy size 17 does not respect `copy_buffer_alignment`"), - ); - try_copy( - &ctx, - 64, - 20 + 2, - Some("copy size 22 does not respect `copy_buffer_alignment`"), - ); - try_copy( - &ctx, - 256, - 44 + 3, - Some("copy size 47 does not respect `copy_buffer_alignment`"), - ); - try_copy(&ctx, 1024, 8 + 4, None); +static COPY_ALIGNMENT: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + try_copy(&ctx, 0, 0, None); + try_copy( + &ctx, + 4, + 16 + 1, + Some("copy size 17 does not respect `copy_buffer_alignment`"), + ); + try_copy( + &ctx, + 64, + 20 + 2, + Some("copy size 22 does not respect `copy_buffer_alignment`"), + ); + try_copy( + &ctx, + 256, + 44 + 3, + Some("copy size 47 does not respect `copy_buffer_alignment`"), + ); + try_copy(&ctx, 1024, 8 + 4, None); - try_copy(&ctx, 0, 4, None); - try_copy( - &ctx, - 4 + 1, - 8, - Some("buffer offset 5 is not aligned to block size or `copy_buffer_alignment`"), - ); - try_copy( - &ctx, - 64 + 2, - 12, - Some("buffer offset 66 is not aligned to block size or `copy_buffer_alignment`"), - ); - try_copy( - &ctx, - 256 + 3, - 16, - Some("buffer offset 259 is not aligned to block size or `copy_buffer_alignment`"), - ); - try_copy(&ctx, 1024 + 4, 4, None); -}); + try_copy(&ctx, 0, 4, None); + try_copy( + &ctx, + 4 + 1, + 8, + Some("buffer offset 5 is not aligned to block size or `copy_buffer_alignment`"), + ); + try_copy( + &ctx, + 64 + 2, + 12, + Some("buffer offset 66 is not aligned to block size or `copy_buffer_alignment`"), + ); + try_copy( + &ctx, + 256 + 3, + 16, + Some("buffer offset 259 is not aligned to block size or `copy_buffer_alignment`"), + ); + try_copy(&ctx, 1024 + 4, 4, None); + }); const BUFFER_SIZE: BufferAddress = 1234; diff --git a/tests/tests/wgpu-gpu/buffer_usages.rs b/tests/tests/wgpu-gpu/buffer_usages.rs index a5c6fe696..f4ee67baf 100644 --- a/tests/tests/wgpu-gpu/buffer_usages.rs +++ b/tests/tests/wgpu-gpu/buffer_usages.rs @@ -59,20 +59,26 @@ fn try_create(ctx: TestingContext, usages: &[(bool, &[wgpu::BufferUsages])]) { } #[gpu_test] -static BUFFER_USAGE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - try_create( - ctx, - &[ - (false, ALWAYS_VALID), - (true, NEEDS_MAPPABLE_PRIMARY_BUFFERS), - (true, ALWAYS_FAIL), - ], - ); -}); +static BUFFER_USAGE: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + try_create( + ctx, + &[ + (false, ALWAYS_VALID), + (true, NEEDS_MAPPABLE_PRIMARY_BUFFERS), + (true, ALWAYS_FAIL), + ], + ); + }); #[gpu_test] static BUFFER_USAGE_MAPPABLE_PRIMARY_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS)) + .parameters( + TestParameters::default() + .features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS) + .enable_noop(), + ) .run_sync(|ctx| { try_create( ctx, @@ -169,7 +175,11 @@ async fn map_test( #[gpu_test] static BUFFER_MAP_ASYNC_MAP_STATE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS)) + .parameters( + TestParameters::default() + .features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS) + .enable_noop(), + ) .run_async(move |ctx| async move { for usage_type in ["invalid", "read", "write"] { for map_mode_type in [Ma::Read, Ma::Write] { diff --git a/tests/tests/wgpu-gpu/cloneable_types.rs b/tests/tests/wgpu-gpu/cloneable_types.rs index eac6edb17..cf09d24ff 100644 --- a/tests/tests/wgpu-gpu/cloneable_types.rs +++ b/tests/tests/wgpu-gpu/cloneable_types.rs @@ -1,12 +1,13 @@ -use wgpu_test::{gpu_test, GpuTestInitializer, TestingContext}; +use wgpu_test::{gpu_test, GpuTestInitializer, TestParameters, TestingContext}; pub fn all_tests(vec: &mut Vec) { vec.push(CLONEABLE_BUFFERS); } #[gpu_test] -static CLONEABLE_BUFFERS: GpuTestConfiguration = - wgpu_test::GpuTestConfiguration::new().run_sync(cloneable_buffers); +static CLONEABLE_BUFFERS: GpuTestConfiguration = wgpu_test::GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(cloneable_buffers); // Test a basic case of cloneable types where you clone the buffer to be able // to access the buffer inside the callback as well as outside. diff --git a/tests/tests/wgpu-gpu/compute_pass_ownership.rs b/tests/tests/wgpu-gpu/compute_pass_ownership.rs index e988dcc48..2903a517c 100644 --- a/tests/tests/wgpu-gpu/compute_pass_ownership.rs +++ b/tests/tests/wgpu-gpu/compute_pass_ownership.rs @@ -175,7 +175,11 @@ async fn compute_pass_query_set_ownership_timestamps(ctx: TestingContext) { #[gpu_test] static COMPUTE_PASS_KEEP_ENCODER_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_async(compute_pass_keep_encoder_alive); async fn compute_pass_keep_encoder_alive(ctx: TestingContext) { diff --git a/tests/tests/wgpu-gpu/device.rs b/tests/tests/wgpu-gpu/device.rs index 7de961d50..002ce316a 100644 --- a/tests/tests/wgpu-gpu/device.rs +++ b/tests/tests/wgpu-gpu/device.rs @@ -26,7 +26,11 @@ pub fn all_tests(vec: &mut Vec) { #[gpu_test] static CROSS_DEVICE_BIND_GROUP_USAGE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().expect_fail(FailureCase::always())) + .parameters( + TestParameters::default() + .expect_fail(FailureCase::always()) + .enable_noop(), + ) .run_async(|ctx| async move { // Create a bind group using a layout from another device. This should be a validation // error but currently crashes. @@ -53,7 +57,7 @@ static CROSS_DEVICE_BIND_GROUP_USAGE: GpuTestConfiguration = GpuTestConfiguratio #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] #[gpu_test] static DEVICE_LIFETIME_CHECK: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { ctx.instance.poll_all(false); @@ -80,7 +84,7 @@ static DEVICE_LIFETIME_CHECK: GpuTestConfiguration = GpuTestConfiguration::new() #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] #[gpu_test] static MULTIPLE_DEVICES: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { use pollster::FutureExt as _; ctx.adapter @@ -162,7 +166,11 @@ async fn request_device_error_message() { // should turn into no-ops, per spec. #[gpu_test] static DEVICE_DESTROY_THEN_MORE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::CLEAR_TEXTURE)) + .parameters( + TestParameters::default() + .features(wgpu::Features::CLEAR_TEXTURE) + .enable_noop(), + ) .run_sync(|ctx| { // Create some resources on the device that we will attempt to use *after* losing // the device. @@ -474,7 +482,7 @@ static DEVICE_DESTROY_THEN_MORE: GpuTestConfiguration = GpuTestConfiguration::ne #[gpu_test] static DEVICE_DESTROY_THEN_LOST: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_async(|ctx| async move { // This test checks that when device.destroy is called, the provided // DeviceLostClosure is called with reason DeviceLostReason::Destroyed. @@ -509,7 +517,7 @@ static DEVICE_DESTROY_THEN_LOST: GpuTestConfiguration = GpuTestConfiguration::ne #[gpu_test] static DIFFERENT_BGL_ORDER_BW_SHADER_AND_API: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { // This test addresses a bug found in multiple backends where `wgpu_core` and `wgpu_hal` // backends made different assumptions about the element order of vectors of bind group @@ -636,7 +644,7 @@ static DIFFERENT_BGL_ORDER_BW_SHADER_AND_API: GpuTestConfiguration = GpuTestConf #[gpu_test] static DEVICE_DESTROY_THEN_BUFFER_CLEANUP: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { // When a device is destroyed, its resources should be released, // without causing a deadlock. @@ -675,7 +683,7 @@ static DEVICE_DESTROY_THEN_BUFFER_CLEANUP: GpuTestConfiguration = GpuTestConfigu #[gpu_test] static DEVICE_AND_QUEUE_HAVE_DIFFERENT_IDS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_async(|ctx| async move { let TestingContext { adapter, diff --git a/tests/tests/wgpu-gpu/dispatch_workgroups_indirect.rs b/tests/tests/wgpu-gpu/dispatch_workgroups_indirect.rs index 9010389b1..24a38604f 100644 --- a/tests/tests/wgpu-gpu/dispatch_workgroups_indirect.rs +++ b/tests/tests/wgpu-gpu/dispatch_workgroups_indirect.rs @@ -74,7 +74,7 @@ static RESET_BIND_GROUPS: GpuTestConfiguration = GpuTestConfiguration::new() .limits(wgpu::Limits { max_push_constant_size: 4, ..wgpu::Limits::downlevel_defaults() - }), + }).enable_noop(), ) .run_async(|ctx| async move { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); @@ -116,7 +116,8 @@ static ZERO_SIZED_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new() .limits(wgpu::Limits { max_push_constant_size: 4, ..wgpu::Limits::downlevel_defaults() - }), + }) + .enable_noop(), ) .run_async(|ctx| async move { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); diff --git a/tests/tests/wgpu-gpu/draw_indirect.rs b/tests/tests/wgpu-gpu/draw_indirect.rs index ab2f09098..a0c8253be 100644 --- a/tests/tests/wgpu-gpu/draw_indirect.rs +++ b/tests/tests/wgpu-gpu/draw_indirect.rs @@ -343,12 +343,18 @@ macro_rules! make_test { ($name:ident, $test_data:expr, $expect_noop:expr, $features:expr) => { #[gpu_test] static $name: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters( - TestParameters::default() + .parameters({ + let params = TestParameters::default() .downlevel_flags(wgpu::DownlevelFlags::INDIRECT_EXECUTION) .features($features) - .limits(wgpu::Limits::downlevel_defaults()), - ) + .limits(wgpu::Limits::downlevel_defaults()); + + if $expect_noop { + params.enable_noop() + } else { + params + } + }) .run_async(|ctx| run_test(ctx, $test_data, $expect_noop)); }; } diff --git a/tests/tests/wgpu-gpu/dual_source_blending.rs b/tests/tests/wgpu-gpu/dual_source_blending.rs index 3bd55945a..eeffa72e5 100644 --- a/tests/tests/wgpu-gpu/dual_source_blending.rs +++ b/tests/tests/wgpu-gpu/dual_source_blending.rs @@ -55,7 +55,7 @@ fn blend_state_with_dual_source_blending() -> BlendState { #[gpu_test] static DUAL_SOURCE_BLENDING_FEATURE_DISABLED: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_async(dual_source_blending_disabled); async fn dual_source_blending_disabled(ctx: TestingContext) { @@ -118,7 +118,11 @@ async fn dual_source_blending_disabled(ctx: TestingContext) { #[gpu_test] static DUAL_SOURCE_BLENDING_FEATURE_ENABLED: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::DUAL_SOURCE_BLENDING)) + .parameters( + TestParameters::default() + .features(wgpu::Features::DUAL_SOURCE_BLENDING) + .enable_noop(), + ) .run_async(dual_source_blending_enabled); async fn dual_source_blending_enabled(ctx: TestingContext) { diff --git a/tests/tests/wgpu-gpu/encoder.rs b/tests/tests/wgpu-gpu/encoder.rs index 699a1280b..426ef3c80 100644 --- a/tests/tests/wgpu-gpu/encoder.rs +++ b/tests/tests/wgpu-gpu/encoder.rs @@ -15,17 +15,23 @@ pub fn all_tests(vec: &mut Vec) { } #[gpu_test] -static DROP_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - let encoder = ctx - .device - .create_command_encoder(&wgpu::CommandEncoderDescriptor::default()); - drop(encoder); -}); +static DROP_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + let encoder = ctx + .device + .create_command_encoder(&wgpu::CommandEncoderDescriptor::default()); + drop(encoder); + }); #[gpu_test] static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().expect_fail(FailureCase::always())) + .parameters( + TestParameters::default() + .expect_fail(FailureCase::always()) + .enable_noop(), + ) .run_sync(|ctx| { // Use the device after the queue is dropped. Currently this panics // but it probably shouldn't. @@ -38,7 +44,7 @@ static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration = #[gpu_test] static DROP_ENCODER_AFTER_ERROR: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let mut encoder = ctx .device @@ -82,11 +88,15 @@ static DROP_ENCODER_AFTER_ERROR: GpuTestConfiguration = GpuTestConfiguration::ne #[gpu_test] static ENCODER_OPERATIONS_FAIL_WHILE_PASS_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features( - wgpu::Features::CLEAR_TEXTURE - | wgpu::Features::TIMESTAMP_QUERY - | wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS, - )) + .parameters( + TestParameters::default() + .features( + wgpu::Features::CLEAR_TEXTURE + | wgpu::Features::TIMESTAMP_QUERY + | wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS, + ) + .enable_noop(), + ) .run_sync(encoder_operations_fail_while_pass_alive); fn encoder_operations_fail_while_pass_alive(ctx: TestingContext) { diff --git a/tests/tests/wgpu-gpu/float32_filterable.rs b/tests/tests/wgpu-gpu/float32_filterable.rs index ba623e0be..c18a3e641 100644 --- a/tests/tests/wgpu-gpu/float32_filterable.rs +++ b/tests/tests/wgpu-gpu/float32_filterable.rs @@ -53,7 +53,7 @@ fn create_texture_binding(device: &wgpu::Device, format: wgpu::TextureFormat, fi #[gpu_test] static FLOAT32_FILTERABLE_WITHOUT_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let device = &ctx.device; // Unorm textures are always filterable @@ -80,7 +80,11 @@ static FLOAT32_FILTERABLE_WITHOUT_FEATURE: GpuTestConfiguration = GpuTestConfigu #[gpu_test] static FLOAT32_FILTERABLE_WITH_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::FLOAT32_FILTERABLE)) + .parameters( + TestParameters::default() + .features(wgpu::Features::FLOAT32_FILTERABLE) + .enable_noop(), + ) .run_sync(|ctx| { let device = &ctx.device; // With the feature enabled, it does work! diff --git a/tests/tests/wgpu-gpu/image_atomics/mod.rs b/tests/tests/wgpu-gpu/image_atomics/mod.rs index c11d9250a..0d1b3d080 100644 --- a/tests/tests/wgpu-gpu/image_atomics/mod.rs +++ b/tests/tests/wgpu-gpu/image_atomics/mod.rs @@ -172,7 +172,7 @@ async fn test_format( #[gpu_test] static IMAGE_ATOMICS_NOT_ENABLED: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 256, @@ -200,7 +200,7 @@ static IMAGE_ATOMICS_NOT_ENABLED: GpuTestConfiguration = GpuTestConfiguration::n #[gpu_test] static IMAGE_ATOMICS_NOT_SUPPORTED: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_ATOMIC)) + .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_ATOMIC).enable_noop()) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 256, diff --git a/tests/tests/wgpu-gpu/instance.rs b/tests/tests/wgpu-gpu/instance.rs index 6f882b625..adab85f2a 100644 --- a/tests/tests/wgpu-gpu/instance.rs +++ b/tests/tests/wgpu-gpu/instance.rs @@ -1,8 +1,10 @@ -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.push(INITIALIZE); } #[gpu_test] -static INITIALIZE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|_ctx| {}); +static INITIALIZE: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|_ctx| {}); diff --git a/tests/tests/wgpu-gpu/life_cycle.rs b/tests/tests/wgpu-gpu/life_cycle.rs index 869f963f2..c7c5786b9 100644 --- a/tests/tests/wgpu-gpu/life_cycle.rs +++ b/tests/tests/wgpu-gpu/life_cycle.rs @@ -13,8 +13,9 @@ pub fn all_tests(vec: &mut Vec) { } #[gpu_test] -static BUFFER_DESTROY: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static BUFFER_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor { label: Some("buffer"), size: 256, @@ -80,8 +81,9 @@ static BUFFER_DESTROY: GpuTestConfiguration = }); #[gpu_test] -static TEXTURE_DESTROY: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static TEXTURE_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let texture = ctx.device.create_texture(&wgpu::TextureDescriptor { label: None, size: wgpu::Extent3d { @@ -118,7 +120,9 @@ static TEXTURE_DESTROY: GpuTestConfiguration = static BUFFER_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new() .parameters( // https://github.com/gfx-rs/wgpu/issues/7854 - TestParameters::default().skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe")), + TestParameters::default() + .skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe")) + .enable_noop(), ) .run_sync(|ctx| { let buffer_source = ctx @@ -158,7 +162,9 @@ static BUFFER_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration static TEXTURE_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new() .parameters( // https://github.com/gfx-rs/wgpu/issues/7854 - TestParameters::default().skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe")), + TestParameters::default() + .skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe")) + .enable_noop(), ) .run_sync(|ctx| { let descriptor = wgpu::TextureDescriptor { diff --git a/tests/tests/wgpu-gpu/mem_leaks.rs b/tests/tests/wgpu-gpu/mem_leaks.rs index 456b04e8e..c58981d5b 100644 --- a/tests/tests/wgpu-gpu/mem_leaks.rs +++ b/tests/tests/wgpu-gpu/mem_leaks.rs @@ -310,7 +310,8 @@ static SIMPLE_DRAW_CHECK_MEM_LEAKS: wgpu_test::GpuTestConfiguration = .parameters( wgpu_test::TestParameters::default() .test_features_limits() - .features(wgpu::Features::VERTEX_WRITABLE_STORAGE), + .features(wgpu::Features::VERTEX_WRITABLE_STORAGE) + .enable_noop(), ) .run_async(|ctx| { draw_test_with_reports(ctx, &[0, 1, 2, 3, 4, 5], |cmb| { diff --git a/tests/tests/wgpu-gpu/nv12_texture/mod.rs b/tests/tests/wgpu-gpu/nv12_texture/mod.rs index bbe3c4508..ced957ca3 100644 --- a/tests/tests/wgpu-gpu/nv12_texture/mod.rs +++ b/tests/tests/wgpu-gpu/nv12_texture/mod.rs @@ -14,7 +14,11 @@ pub fn all_tests(tests: &mut Vec) { #[gpu_test] static NV12_TEXTURE_CREATION_SAMPLING: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12)) + .parameters( + TestParameters::default() + .features(wgpu::Features::TEXTURE_FORMAT_NV12) + .enable_noop(), + ) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 256, @@ -135,7 +139,11 @@ static NV12_TEXTURE_CREATION_SAMPLING: GpuTestConfiguration = GpuTestConfigurati #[gpu_test] static NV12_TEXTURE_VIEW_PLANE_ON_NON_PLANAR_FORMAT: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12)) + .parameters( + TestParameters::default() + .features(wgpu::Features::TEXTURE_FORMAT_NV12) + .enable_noop(), + ) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 256, @@ -166,7 +174,11 @@ static NV12_TEXTURE_VIEW_PLANE_ON_NON_PLANAR_FORMAT: GpuTestConfiguration = #[gpu_test] static NV12_TEXTURE_VIEW_PLANE_OUT_OF_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12)) + .parameters( + TestParameters::default() + .features(wgpu::Features::TEXTURE_FORMAT_NV12) + .enable_noop(), + ) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 256, @@ -198,7 +210,11 @@ static NV12_TEXTURE_VIEW_PLANE_OUT_OF_BOUNDS: GpuTestConfiguration = GpuTestConf #[gpu_test] static NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12)) + .parameters( + TestParameters::default() + .features(wgpu::Features::TEXTURE_FORMAT_NV12) + .enable_noop(), + ) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 256, @@ -230,7 +246,11 @@ static NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE: GpuTestConfiguration = GpuTestConfigu #[gpu_test] static NV12_TEXTURE_BAD_SIZE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12)) + .parameters( + TestParameters::default() + .features(wgpu::Features::TEXTURE_FORMAT_NV12) + .enable_noop(), + ) .run_sync(|ctx| { let size = wgpu::Extent3d { width: 255, diff --git a/tests/tests/wgpu-gpu/pipeline.rs b/tests/tests/wgpu-gpu/pipeline.rs index 5ec40915c..aa62032a5 100644 --- a/tests/tests/wgpu-gpu/pipeline.rs +++ b/tests/tests/wgpu-gpu/pipeline.rs @@ -42,7 +42,7 @@ const TRIVIAL_FRAGMENT_SHADER_DESC: wgpu::ShaderModuleDescriptor = wgpu::ShaderM #[gpu_test] static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); @@ -72,7 +72,11 @@ static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration = #[gpu_test] static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(|ctx| { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); @@ -101,7 +105,7 @@ static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration = #[gpu_test] static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); @@ -138,7 +142,11 @@ static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration = #[gpu_test] static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_sync(|ctx| { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); @@ -186,7 +194,7 @@ static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration = #[gpu_test] static NO_TARGETLESS_RENDER: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { fail( &ctx.device, diff --git a/tests/tests/wgpu-gpu/poll.rs b/tests/tests/wgpu-gpu/poll.rs index 15a4db54e..70d3b393c 100644 --- a/tests/tests/wgpu-gpu/poll.rs +++ b/tests/tests/wgpu-gpu/poll.rs @@ -6,7 +6,9 @@ use wgpu::{ CommandEncoderDescriptor, ComputePassDescriptor, PollType, ShaderStages, }; -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestingContext}; +use wgpu_test::{ + gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext, +}; pub fn all_tests(vec: &mut Vec) { vec.extend([ @@ -64,16 +66,19 @@ fn generate_dummy_work(ctx: &TestingContext) -> CommandBuffer { } #[gpu_test] -static WAIT: GpuTestConfiguration = GpuTestConfiguration::new().run_async(|ctx| async move { - let cmd_buf = generate_dummy_work(&ctx); +static WAIT: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { + let cmd_buf = generate_dummy_work(&ctx); - ctx.queue.submit(Some(cmd_buf)); - ctx.async_poll(PollType::wait()).await.unwrap(); -}); + ctx.queue.submit(Some(cmd_buf)); + ctx.async_poll(PollType::wait()).await.unwrap(); + }); #[gpu_test] -static DOUBLE_WAIT: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static DOUBLE_WAIT: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let cmd_buf = generate_dummy_work(&ctx); ctx.queue.submit(Some(cmd_buf)); @@ -82,8 +87,9 @@ static DOUBLE_WAIT: GpuTestConfiguration = }); #[gpu_test] -static WAIT_ON_SUBMISSION: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static WAIT_ON_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let cmd_buf = generate_dummy_work(&ctx); let index = ctx.queue.submit(Some(cmd_buf)); @@ -91,8 +97,9 @@ static WAIT_ON_SUBMISSION: GpuTestConfiguration = }); #[gpu_test] -static DOUBLE_WAIT_ON_SUBMISSION: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static DOUBLE_WAIT_ON_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let cmd_buf = generate_dummy_work(&ctx); let index = ctx.queue.submit(Some(cmd_buf)); @@ -103,8 +110,9 @@ static DOUBLE_WAIT_ON_SUBMISSION: GpuTestConfiguration = }); #[gpu_test] -static WAIT_OUT_OF_ORDER: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static WAIT_OUT_OF_ORDER: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let cmd_buf1 = generate_dummy_work(&ctx); let cmd_buf2 = generate_dummy_work(&ctx); @@ -120,7 +128,11 @@ static WAIT_OUT_OF_ORDER: GpuTestConfiguration = /// console. #[gpu_test] static WAIT_AFTER_BAD_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(wgpu_test::TestParameters::default().skip(wgpu_test::FailureCase::webgl2())) + .parameters( + wgpu_test::TestParameters::default() + .skip(wgpu_test::FailureCase::webgl2()) + .enable_noop(), + ) .run_async(wait_after_bad_submission); async fn wait_after_bad_submission(ctx: TestingContext) { diff --git a/tests/tests/wgpu-gpu/query_set.rs b/tests/tests/wgpu-gpu/query_set.rs index 4858560dd..4aee905d3 100644 --- a/tests/tests/wgpu-gpu/query_set.rs +++ b/tests/tests/wgpu-gpu/query_set.rs @@ -6,7 +6,7 @@ pub fn all_tests(vec: &mut Vec) { #[gpu_test] static DROP_FAILED_TIMESTAMP_QUERY_SET: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { // Enter an error scope, so the validation catch-all doesn't // report the error too early. diff --git a/tests/tests/wgpu-gpu/queue_transfer.rs b/tests/tests/wgpu-gpu/queue_transfer.rs index 7397568cd..79abefaca 100644 --- a/tests/tests/wgpu-gpu/queue_transfer.rs +++ b/tests/tests/wgpu-gpu/queue_transfer.rs @@ -1,7 +1,7 @@ //! Tests for buffer copy validation. use wgpu::PollType; -use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.extend([ @@ -13,6 +13,7 @@ pub fn all_tests(vec: &mut Vec) { #[gpu_test] static QUEUE_WRITE_TEXTURE_THEN_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let texture = ctx.device.create_texture(&wgpu::TextureDescriptor { label: None, @@ -61,8 +62,9 @@ static QUEUE_WRITE_TEXTURE_THEN_DESTROY: GpuTestConfiguration = GpuTestConfigura }); #[gpu_test] -static QUEUE_WRITE_TEXTURE_OVERFLOW: GpuTestConfiguration = - GpuTestConfiguration::new().run_sync(|ctx| { +static QUEUE_WRITE_TEXTURE_OVERFLOW: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { let texture = ctx.device.create_texture(&wgpu::TextureDescriptor { label: None, size: wgpu::Extent3d { diff --git a/tests/tests/wgpu-gpu/ray_tracing/as_build.rs b/tests/tests/wgpu-gpu/ray_tracing/as_build.rs index 558bc6265..af9a811a7 100644 --- a/tests/tests/wgpu-gpu/ray_tracing/as_build.rs +++ b/tests/tests/wgpu-gpu/ray_tracing/as_build.rs @@ -66,7 +66,8 @@ static UNBUILT_BLAS_COMPACTION: GpuTestConfiguration = GpuTestConfiguration::new TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(unbuilt_blas_compaction); @@ -128,7 +129,8 @@ static UNPREPARED_BLAS_COMPACTION: GpuTestConfiguration = GpuTestConfiguration:: TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(unprepared_blas_compaction); @@ -295,7 +297,8 @@ static OUT_OF_ORDER_AS_BUILD_USE: GpuTestConfiguration = GpuTestConfiguration::n TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(out_of_order_as_build_use); @@ -477,7 +480,8 @@ static EMPTY_BUILD: GpuTestConfiguration = GpuTestConfiguration::new() TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(empty_build); fn empty_build(ctx: TestingContext) { @@ -498,7 +502,8 @@ static BUILD_WITH_TRANSFORM: GpuTestConfiguration = GpuTestConfiguration::new() TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(build_with_transform); @@ -710,7 +715,8 @@ static ONLY_TLAS_VERTEX_RETURN: GpuTestConfiguration = GpuTestConfiguration::new .features( wgpu::Features::EXPERIMENTAL_RAY_QUERY | wgpu::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN, - ), + ) + .enable_noop(), ) .run_sync(only_tlas_vertex_return); @@ -749,7 +755,8 @@ static EXTRA_FORMAT_BUILD: GpuTestConfiguration = GpuTestConfiguration::new() .features( wgpu::Features::EXPERIMENTAL_RAY_QUERY | wgpu::Features::EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS, - ), + ) + .enable_noop(), ) .run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Snorm16x4, 6, false)); @@ -759,7 +766,8 @@ static MISALIGNED_BUILD: GpuTestConfiguration = GpuTestConfiguration::new() TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) // Larger than the minimum size, but not aligned as required .run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Float32x3, 13, true)); @@ -770,7 +778,8 @@ static TOO_SMALL_STRIDE_BUILD: GpuTestConfiguration = GpuTestConfiguration::new( TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) // Aligned as required, but smaller than minimum size .run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Float32x3, 8, true)); diff --git a/tests/tests/wgpu-gpu/ray_tracing/as_create.rs b/tests/tests/wgpu-gpu/ray_tracing/as_create.rs index 76ccbc9d8..19edb096b 100644 --- a/tests/tests/wgpu-gpu/ray_tracing/as_create.rs +++ b/tests/tests/wgpu-gpu/ray_tracing/as_create.rs @@ -18,7 +18,8 @@ static BLAS_INVALID_VERTEX_FORMAT: GpuTestConfiguration = GpuTestConfiguration:: TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(invalid_vertex_format_blas_create); @@ -59,7 +60,8 @@ static BLAS_MISMATCHED_INDEX: GpuTestConfiguration = GpuTestConfiguration::new() TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(mismatched_index_blas_create); diff --git a/tests/tests/wgpu-gpu/ray_tracing/limits.rs b/tests/tests/wgpu-gpu/ray_tracing/limits.rs index d8448eec6..c1ee870f8 100644 --- a/tests/tests/wgpu-gpu/ray_tracing/limits.rs +++ b/tests/tests/wgpu-gpu/ray_tracing/limits.rs @@ -26,7 +26,8 @@ static LIMITS_HIT: GpuTestConfiguration = GpuTestConfiguration::new() max_acceleration_structures_per_shader_stage: 1, ..Limits::default() }) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(hit_limits); diff --git a/tests/tests/wgpu-gpu/ray_tracing/scene/mod.rs b/tests/tests/wgpu-gpu/ray_tracing/scene/mod.rs index 45cf7924d..d71092dd8 100644 --- a/tests/tests/wgpu-gpu/ray_tracing/scene/mod.rs +++ b/tests/tests/wgpu-gpu/ray_tracing/scene/mod.rs @@ -110,7 +110,8 @@ static ACCELERATION_STRUCTURE_BUILD_NO_INDEX: GpuTestConfiguration = GpuTestConf TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(|ctx| { acceleration_structure_build(&ctx, false); @@ -122,7 +123,8 @@ static ACCELERATION_STRUCTURE_BUILD_WITH_INDEX: GpuTestConfiguration = GpuTestCo TestParameters::default() .test_features_limits() .limits(acceleration_structure_limits()) - .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY), + .features(wgpu::Features::EXPERIMENTAL_RAY_QUERY) + .enable_noop(), ) .run_sync(|ctx| { acceleration_structure_build(&ctx, true); diff --git a/tests/tests/wgpu-gpu/regression/issue_3457.rs b/tests/tests/wgpu-gpu/regression/issue_3457.rs index 1a84ecba3..4b7503776 100644 --- a/tests/tests/wgpu-gpu/regression/issue_3457.rs +++ b/tests/tests/wgpu-gpu/regression/issue_3457.rs @@ -1,4 +1,4 @@ -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; use wgpu::*; @@ -19,8 +19,9 @@ pub fn all_tests(vec: &mut Vec) { /// We use non-consecutive vertex attribute locations (0 and 5) in order to also test /// that we unset the correct locations (see PR #3706). #[gpu_test] -static PASS_RESET_VERTEX_BUFFER: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static PASS_RESET_VERTEX_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let module = ctx .device .create_shader_module(include_wgsl!("issue_3457.wgsl")); diff --git a/tests/tests/wgpu-gpu/regression/issue_4024.rs b/tests/tests/wgpu-gpu/regression/issue_4024.rs index 8e648813d..036a44f61 100644 --- a/tests/tests/wgpu-gpu/regression/issue_4024.rs +++ b/tests/tests/wgpu-gpu/regression/issue_4024.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use parking_lot::Mutex; -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; use wgpu::*; @@ -18,6 +18,7 @@ pub fn all_tests(vec: &mut Vec) { /// to add them to. This is incorrect, as we do not immediately invoke map_async callbacks. #[gpu_test] static QUEUE_SUBMITTED_CALLBACK_ORDERING: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) .run_async(|ctx| async move { // Create a mappable buffer let buffer = ctx.device.create_buffer(&BufferDescriptor { diff --git a/tests/tests/wgpu-gpu/regression/issue_4122.rs b/tests/tests/wgpu-gpu/regression/issue_4122.rs index f59897a19..e858c800f 100644 --- a/tests/tests/wgpu-gpu/regression/issue_4122.rs +++ b/tests/tests/wgpu-gpu/regression/issue_4122.rs @@ -91,7 +91,7 @@ async fn fill_test(ctx: &TestingContext, range: Range, size: u64) -> bool { /// This test will fail on nvidia if the bug is not properly worked around. #[gpu_test] static CLEAR_BUFFER_RANGE_RESPECTED: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_async(|ctx| async move { // This hits most of the cases in nvidia's clear buffer bug let mut succeeded = true; diff --git a/tests/tests/wgpu-gpu/regression/issue_4485.rs b/tests/tests/wgpu-gpu/regression/issue_4485.rs index aa6e27bfe..5c8143778 100644 --- a/tests/tests/wgpu-gpu/regression/issue_4485.rs +++ b/tests/tests/wgpu-gpu/regression/issue_4485.rs @@ -16,7 +16,7 @@ pub fn all_tests(vec: &mut Vec) { /// This also tests that shaders generated with this fix execute correctly. #[gpu_test] static CONTINUE_SWITCH: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().force_fxc(true)) + .parameters(TestParameters::default().force_fxc(true).enable_noop()) .run_async(|ctx| async move { test_impl(&ctx).await }); async fn test_impl(ctx: &TestingContext) { diff --git a/tests/tests/wgpu-gpu/regression/issue_4514.rs b/tests/tests/wgpu-gpu/regression/issue_4514.rs index 8eb9b436f..f3ad2051a 100644 --- a/tests/tests/wgpu-gpu/regression/issue_4514.rs +++ b/tests/tests/wgpu-gpu/regression/issue_4514.rs @@ -16,7 +16,7 @@ pub fn all_tests(vec: &mut Vec) { /// bug is avoided there. #[gpu_test] static DEGENERATE_SWITCH: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().force_fxc(true)) + .parameters(TestParameters::default().force_fxc(true).enable_noop()) .run_async(|ctx| async move { test_impl(&ctx).await }); async fn test_impl(ctx: &TestingContext) { diff --git a/tests/tests/wgpu-gpu/regression/issue_5553.rs b/tests/tests/wgpu-gpu/regression/issue_5553.rs index b9f996121..7c1884dc3 100644 --- a/tests/tests/wgpu-gpu/regression/issue_5553.rs +++ b/tests/tests/wgpu-gpu/regression/issue_5553.rs @@ -1,4 +1,4 @@ -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; use wgpu::*; @@ -14,8 +14,9 @@ pub fn all_tests(vec: &mut Vec) { /// the fragment inputs. This is necessary for generating correct hlsl: /// https://github.com/gfx-rs/wgpu/issues/5553 #[gpu_test] -static ALLOW_INPUT_NOT_CONSUMED: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static ALLOW_INPUT_NOT_CONSUMED: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let module = ctx .device .create_shader_module(include_wgsl!("issue_5553.wgsl")); diff --git a/tests/tests/wgpu-gpu/regression/issue_6317.rs b/tests/tests/wgpu-gpu/regression/issue_6317.rs index e955d2a5a..fd42885be 100644 --- a/tests/tests/wgpu-gpu/regression/issue_6317.rs +++ b/tests/tests/wgpu-gpu/regression/issue_6317.rs @@ -11,7 +11,8 @@ static NON_FATAL_ERRORS_IN_QUEUE_SUBMIT: GpuTestConfiguration = GpuTestConfigura .parameters( TestParameters::default() .downlevel_flags(DownlevelFlags::COMPUTE_SHADERS) - .limits(Limits::downlevel_defaults()), + .limits(Limits::downlevel_defaults()) + .enable_noop(), ) .run_sync(|ctx| { let shader_with_trivial_bind_group = concat!( diff --git a/tests/tests/wgpu-gpu/regression/issue_6467.rs b/tests/tests/wgpu-gpu/regression/issue_6467.rs index 9458eb511..84d680d01 100644 --- a/tests/tests/wgpu-gpu/regression/issue_6467.rs +++ b/tests/tests/wgpu-gpu/regression/issue_6467.rs @@ -13,7 +13,11 @@ pub fn all_tests(vec: &mut Vec) { /// The following test should successfully do nothing on all platforms. #[gpu_test] static ZERO_WORKGROUP_COUNT: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().limits(wgpu::Limits::default())) + .parameters( + TestParameters::default() + .limits(wgpu::Limits::default()) + .enable_noop(), + ) .run_async(|ctx| async move { let module = ctx .device diff --git a/tests/tests/wgpu-gpu/render_pass_ownership.rs b/tests/tests/wgpu-gpu/render_pass_ownership.rs index c803c7653..3e2b1a983 100644 --- a/tests/tests/wgpu-gpu/render_pass_ownership.rs +++ b/tests/tests/wgpu-gpu/render_pass_ownership.rs @@ -268,7 +268,11 @@ async fn render_pass_query_set_ownership_timestamps(ctx: TestingContext) { #[gpu_test] static RENDER_PASS_KEEP_ENCODER_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().test_features_limits()) + .parameters( + TestParameters::default() + .test_features_limits() + .enable_noop(), + ) .run_async(render_pass_keep_encoder_alive); async fn render_pass_keep_encoder_alive(ctx: TestingContext) { diff --git a/tests/tests/wgpu-gpu/resource_descriptor_accessor.rs b/tests/tests/wgpu-gpu/resource_descriptor_accessor.rs index 88472739e..5a25ab0cb 100644 --- a/tests/tests/wgpu-gpu/resource_descriptor_accessor.rs +++ b/tests/tests/wgpu-gpu/resource_descriptor_accessor.rs @@ -1,21 +1,23 @@ -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.push(BUFFER_SIZE_AND_USAGE); } #[gpu_test] -static BUFFER_SIZE_AND_USAGE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor { - label: None, - size: 1234, - usage: wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST, - mapped_at_creation: false, - }); +static BUFFER_SIZE_AND_USAGE: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor { + label: None, + size: 1234, + usage: wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST, + mapped_at_creation: false, + }); - assert_eq!(buffer.size(), 1234); - assert_eq!( - buffer.usage(), - wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST - ); -}); + assert_eq!(buffer.size(), 1234); + assert_eq!( + buffer.usage(), + wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST + ); + }); diff --git a/tests/tests/wgpu-gpu/resource_error.rs b/tests/tests/wgpu-gpu/resource_error.rs index eb8390b90..e8f923549 100644 --- a/tests/tests/wgpu-gpu/resource_error.rs +++ b/tests/tests/wgpu-gpu/resource_error.rs @@ -1,70 +1,74 @@ -use wgpu_test::{fail, gpu_test, valid, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{fail, gpu_test, valid, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.extend([BAD_BUFFER, BAD_TEXTURE]); } #[gpu_test] -static BAD_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - // Create a buffer with bad parameters and call a few methods. - // Validation should fail but there should be not panic. - let buffer = fail( - &ctx.device, - || { - ctx.device.create_buffer(&wgpu::BufferDescriptor { - label: None, - size: 99999999, - usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::STORAGE, - mapped_at_creation: false, - }) - }, - Some("`map` usage can only be combined with the opposite `copy`"), - ); +static BAD_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + // Create a buffer with bad parameters and call a few methods. + // Validation should fail but there should be not panic. + let buffer = fail( + &ctx.device, + || { + ctx.device.create_buffer(&wgpu::BufferDescriptor { + label: None, + size: 99999999, + usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::STORAGE, + mapped_at_creation: false, + }) + }, + Some("`map` usage can only be combined with the opposite `copy`"), + ); - fail( - &ctx.device, - || buffer.slice(..).map_async(wgpu::MapMode::Write, |_| {}), - Some("Buffer with '' label is invalid"), - ); - fail( - &ctx.device, - || buffer.unmap(), - Some("Buffer with '' label is invalid"), - ); - valid(&ctx.device, || buffer.destroy()); - valid(&ctx.device, || buffer.destroy()); -}); + fail( + &ctx.device, + || buffer.slice(..).map_async(wgpu::MapMode::Write, |_| {}), + Some("Buffer with '' label is invalid"), + ); + fail( + &ctx.device, + || buffer.unmap(), + Some("Buffer with '' label is invalid"), + ); + valid(&ctx.device, || buffer.destroy()); + valid(&ctx.device, || buffer.destroy()); + }); #[gpu_test] -static BAD_TEXTURE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - let texture = fail( - &ctx.device, - || { - ctx.device.create_texture(&wgpu::TextureDescriptor { - label: None, - size: wgpu::Extent3d { - width: 0, - height: 12345678, - depth_or_array_layers: 9001, - }, - mip_level_count: 2000, - sample_count: 27, - dimension: wgpu::TextureDimension::D2, - format: wgpu::TextureFormat::Rgba8UnormSrgb, - usage: wgpu::TextureUsages::all(), - view_formats: &[], - }) - }, - Some("dimension x is zero"), - ); +static BAD_TEXTURE: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + let texture = fail( + &ctx.device, + || { + ctx.device.create_texture(&wgpu::TextureDescriptor { + label: None, + size: wgpu::Extent3d { + width: 0, + height: 12345678, + depth_or_array_layers: 9001, + }, + mip_level_count: 2000, + sample_count: 27, + dimension: wgpu::TextureDimension::D2, + format: wgpu::TextureFormat::Rgba8UnormSrgb, + usage: wgpu::TextureUsages::all(), + view_formats: &[], + }) + }, + Some("dimension x is zero"), + ); - fail( - &ctx.device, - || { - let _ = texture.create_view(&wgpu::TextureViewDescriptor::default()); - }, - Some("Texture with '' label is invalid"), - ); - valid(&ctx.device, || texture.destroy()); - valid(&ctx.device, || texture.destroy()); -}); + fail( + &ctx.device, + || { + let _ = texture.create_view(&wgpu::TextureViewDescriptor::default()); + }, + Some("Texture with '' label is invalid"), + ); + valid(&ctx.device, || texture.destroy()); + valid(&ctx.device, || texture.destroy()); + }); diff --git a/tests/tests/wgpu-gpu/samplers.rs b/tests/tests/wgpu-gpu/samplers.rs index 40b984d21..1192426e4 100644 --- a/tests/tests/wgpu-gpu/samplers.rs +++ b/tests/tests/wgpu-gpu/samplers.rs @@ -21,8 +21,9 @@ pub fn all_tests(vec: &mut Vec) { const PROBABLY_PROBLEMATIC_SAMPLER_COUNT: u32 = 8 * 1024; #[gpu_test] -static SAMPLER_DEDUPLICATION: GpuTestConfiguration = - GpuTestConfiguration::new().run_sync(sampler_deduplication); +static SAMPLER_DEDUPLICATION: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(sampler_deduplication); // Create a large number of samplers from the same two descriptors. // @@ -71,8 +72,9 @@ fn sampler_deduplication(ctx: TestingContext) { } #[gpu_test] -static SAMPLER_CREATION_FAILURE: GpuTestConfiguration = - GpuTestConfiguration::new().run_sync(sampler_creation_failure); +static SAMPLER_CREATION_FAILURE: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(sampler_creation_failure); /// We want to test that sampler creation properly fails when we hit internal sampler /// cache limits. As we don't actually know what the limit is, we first create as many diff --git a/tests/tests/wgpu-gpu/shader/compilation_messages/mod.rs b/tests/tests/wgpu-gpu/shader/compilation_messages/mod.rs index c641565ad..9304836a1 100644 --- a/tests/tests/wgpu-gpu/shader/compilation_messages/mod.rs +++ b/tests/tests/wgpu-gpu/shader/compilation_messages/mod.rs @@ -8,7 +8,7 @@ pub fn all_tests(vec: &mut Vec) { #[gpu_test] static SHADER_COMPILE_SUCCESS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_async(|ctx| async move { let sm = ctx .device @@ -22,7 +22,7 @@ static SHADER_COMPILE_SUCCESS: GpuTestConfiguration = GpuTestConfiguration::new( #[gpu_test] static SHADER_COMPILE_ERROR: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default()) + .parameters(TestParameters::default().enable_noop()) .run_async(|ctx| async move { ctx.device.push_error_scope(wgpu::ErrorFilter::Validation); let sm = ctx diff --git a/tests/tests/wgpu-gpu/texture_binding/mod.rs b/tests/tests/wgpu-gpu/texture_binding/mod.rs index 4f154c362..a77b3c233 100644 --- a/tests/tests/wgpu-gpu/texture_binding/mod.rs +++ b/tests/tests/wgpu-gpu/texture_binding/mod.rs @@ -18,7 +18,8 @@ static TEXTURE_BINDING: GpuTestConfiguration = GpuTestConfiguration::new() .parameters( TestParameters::default() .test_features_limits() - .downlevel_flags(DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT), + .downlevel_flags(DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT) + .enable_noop(), ) .run_sync(texture_binding); diff --git a/tests/tests/wgpu-gpu/texture_blit.rs b/tests/tests/wgpu-gpu/texture_blit.rs index e93587710..e2b0a6c6e 100644 --- a/tests/tests/wgpu-gpu/texture_blit.rs +++ b/tests/tests/wgpu-gpu/texture_blit.rs @@ -1,4 +1,4 @@ -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.extend([ @@ -9,6 +9,7 @@ pub fn all_tests(vec: &mut Vec) { #[gpu_test] static TEXTURE_BLIT_WITH_LINEAR_FILTER_TEST: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let source = ctx.device.create_texture(&wgpu::TextureDescriptor { label: None, @@ -60,6 +61,7 @@ static TEXTURE_BLIT_WITH_LINEAR_FILTER_TEST: GpuTestConfiguration = GpuTestConfi #[gpu_test] static TEXTURE_BLIT_WITH_NEAREST_FILTER_TEST: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) .run_sync(|ctx| { let source = ctx.device.create_texture(&wgpu::TextureDescriptor { label: None, diff --git a/tests/tests/wgpu-gpu/texture_bounds.rs b/tests/tests/wgpu-gpu/texture_bounds.rs index 2f330294a..561e36354 100644 --- a/tests/tests/wgpu-gpu/texture_bounds.rs +++ b/tests/tests/wgpu-gpu/texture_bounds.rs @@ -1,95 +1,97 @@ //! Tests for texture copy bounds checks. -use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration}; +use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.push(BAD_COPY_ORIGIN_TEST); } #[gpu_test] -static BAD_COPY_ORIGIN_TEST: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - let try_origin = |origin, size, should_panic| { - let texture = ctx.device.create_texture(&TEXTURE_DESCRIPTOR); - let data = vec![255; BUFFER_SIZE as usize]; +static BAD_COPY_ORIGIN_TEST: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + let try_origin = |origin, size, should_panic| { + let texture = ctx.device.create_texture(&TEXTURE_DESCRIPTOR); + let data = vec![255; BUFFER_SIZE as usize]; - fail_if( - &ctx.device, - should_panic, - || { - ctx.queue.write_texture( - wgpu::TexelCopyTextureInfo { - texture: &texture, - mip_level: 0, - origin, - aspect: wgpu::TextureAspect::All, - }, - &data, - BUFFER_COPY_LAYOUT, - size, - ) + fail_if( + &ctx.device, + should_panic, + || { + ctx.queue.write_texture( + wgpu::TexelCopyTextureInfo { + texture: &texture, + mip_level: 0, + origin, + aspect: wgpu::TextureAspect::All, + }, + &data, + BUFFER_COPY_LAYOUT, + size, + ) + }, + None, + ); + }; + + try_origin(wgpu::Origin3d { x: 0, y: 0, z: 0 }, TEXTURE_SIZE, false); + try_origin(wgpu::Origin3d { x: 1, y: 0, z: 0 }, TEXTURE_SIZE, true); + try_origin(wgpu::Origin3d { x: 0, y: 1, z: 0 }, TEXTURE_SIZE, true); + try_origin(wgpu::Origin3d { x: 0, y: 0, z: 1 }, TEXTURE_SIZE, true); + + try_origin( + wgpu::Origin3d { + x: TEXTURE_SIZE.width - 1, + y: TEXTURE_SIZE.height - 1, + z: TEXTURE_SIZE.depth_or_array_layers - 1, }, - None, + wgpu::Extent3d { + width: 1, + height: 1, + depth_or_array_layers: 1, + }, + false, ); - }; - - try_origin(wgpu::Origin3d { x: 0, y: 0, z: 0 }, TEXTURE_SIZE, false); - try_origin(wgpu::Origin3d { x: 1, y: 0, z: 0 }, TEXTURE_SIZE, true); - try_origin(wgpu::Origin3d { x: 0, y: 1, z: 0 }, TEXTURE_SIZE, true); - try_origin(wgpu::Origin3d { x: 0, y: 0, z: 1 }, TEXTURE_SIZE, true); - - try_origin( - wgpu::Origin3d { - x: TEXTURE_SIZE.width - 1, - y: TEXTURE_SIZE.height - 1, - z: TEXTURE_SIZE.depth_or_array_layers - 1, - }, - wgpu::Extent3d { - width: 1, - height: 1, - depth_or_array_layers: 1, - }, - false, - ); - try_origin( - wgpu::Origin3d { - x: u32::MAX, - y: 0, - z: 0, - }, - wgpu::Extent3d { - width: 1, - height: 1, - depth_or_array_layers: 1, - }, - true, - ); - try_origin( - wgpu::Origin3d { - x: u32::MAX, - y: 0, - z: 0, - }, - wgpu::Extent3d { - width: 1, - height: 1, - depth_or_array_layers: 1, - }, - true, - ); - try_origin( - wgpu::Origin3d { - x: u32::MAX, - y: 0, - z: 0, - }, - wgpu::Extent3d { - width: 1, - height: 1, - depth_or_array_layers: 1, - }, - true, - ); -}); + try_origin( + wgpu::Origin3d { + x: u32::MAX, + y: 0, + z: 0, + }, + wgpu::Extent3d { + width: 1, + height: 1, + depth_or_array_layers: 1, + }, + true, + ); + try_origin( + wgpu::Origin3d { + x: u32::MAX, + y: 0, + z: 0, + }, + wgpu::Extent3d { + width: 1, + height: 1, + depth_or_array_layers: 1, + }, + true, + ); + try_origin( + wgpu::Origin3d { + x: u32::MAX, + y: 0, + z: 0, + }, + wgpu::Extent3d { + width: 1, + height: 1, + depth_or_array_layers: 1, + }, + true, + ); + }); const TEXTURE_SIZE: wgpu::Extent3d = wgpu::Extent3d { width: 64, diff --git a/tests/tests/wgpu-gpu/texture_view_creation.rs b/tests/tests/wgpu-gpu/texture_view_creation.rs index 82d9fd91f..5bf7ae1fa 100644 --- a/tests/tests/wgpu-gpu/texture_view_creation.rs +++ b/tests/tests/wgpu-gpu/texture_view_creation.rs @@ -14,7 +14,8 @@ static STENCIL_ONLY_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration:: .parameters( TestParameters::default() .skip(FailureCase::webgl2()) // WebGL doesn't have stencil only views - .limits(wgpu::Limits::downlevel_defaults()), + .limits(wgpu::Limits::downlevel_defaults()) + .enable_noop(), ) .run_async(|ctx| async move { for format in [TextureFormat::Stencil8, TextureFormat::Depth24PlusStencil8] { @@ -42,8 +43,9 @@ static STENCIL_ONLY_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration:: }); #[gpu_test] -static DEPTH_ONLY_VIEW_CREATION: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static DEPTH_ONLY_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { for format in [ TextureFormat::Depth16Unorm, TextureFormat::Depth24Plus, @@ -74,7 +76,11 @@ static DEPTH_ONLY_VIEW_CREATION: GpuTestConfiguration = #[gpu_test] static SHARED_USAGE_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().downlevel_flags(DownlevelFlags::VIEW_FORMATS)) + .parameters( + TestParameters::default() + .downlevel_flags(DownlevelFlags::VIEW_FORMATS) + .enable_noop(), + ) .run_async(|ctx| async move { { let (texture_format, view_format) = diff --git a/tests/tests/wgpu-gpu/transfer.rs b/tests/tests/wgpu-gpu/transfer.rs index bb37218b2..0e2adbbc2 100644 --- a/tests/tests/wgpu-gpu/transfer.rs +++ b/tests/tests/wgpu-gpu/transfer.rs @@ -1,73 +1,75 @@ -use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.push(COPY_OVERFLOW_Z); } #[gpu_test] -static COPY_OVERFLOW_Z: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - let mut encoder = ctx - .device - .create_command_encoder(&wgpu::CommandEncoderDescriptor::default()); +static COPY_OVERFLOW_Z: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + let mut encoder = ctx + .device + .create_command_encoder(&wgpu::CommandEncoderDescriptor::default()); - let t1 = ctx.device.create_texture(&wgpu::TextureDescriptor { - label: None, - dimension: wgpu::TextureDimension::D2, - size: wgpu::Extent3d { - width: 256, - height: 256, - depth_or_array_layers: 1, - }, - format: wgpu::TextureFormat::Rgba8Uint, - usage: wgpu::TextureUsages::COPY_DST, - mip_level_count: 1, - sample_count: 1, - view_formats: &[], - }); - let t2 = ctx.device.create_texture(&wgpu::TextureDescriptor { - label: None, - dimension: wgpu::TextureDimension::D2, - size: wgpu::Extent3d { - width: 256, - height: 256, - depth_or_array_layers: 1, - }, - format: wgpu::TextureFormat::Rgba8Uint, - usage: wgpu::TextureUsages::COPY_DST, - mip_level_count: 1, - sample_count: 1, - view_formats: &[], - }); + let t1 = ctx.device.create_texture(&wgpu::TextureDescriptor { + label: None, + dimension: wgpu::TextureDimension::D2, + size: wgpu::Extent3d { + width: 256, + height: 256, + depth_or_array_layers: 1, + }, + format: wgpu::TextureFormat::Rgba8Uint, + usage: wgpu::TextureUsages::COPY_DST, + mip_level_count: 1, + sample_count: 1, + view_formats: &[], + }); + let t2 = ctx.device.create_texture(&wgpu::TextureDescriptor { + label: None, + dimension: wgpu::TextureDimension::D2, + size: wgpu::Extent3d { + width: 256, + height: 256, + depth_or_array_layers: 1, + }, + format: wgpu::TextureFormat::Rgba8Uint, + usage: wgpu::TextureUsages::COPY_DST, + mip_level_count: 1, + sample_count: 1, + view_formats: &[], + }); - fail( - &ctx.device, - || { - // Validation should catch the silly selected z layer range without panicking. - encoder.copy_texture_to_texture( - wgpu::TexelCopyTextureInfo { - texture: &t1, - mip_level: 1, - origin: wgpu::Origin3d::ZERO, - aspect: wgpu::TextureAspect::All, - }, - wgpu::TexelCopyTextureInfo { - texture: &t2, - mip_level: 1, - origin: wgpu::Origin3d { - x: 0, - y: 0, - z: 3824276442, + fail( + &ctx.device, + || { + // Validation should catch the silly selected z layer range without panicking. + encoder.copy_texture_to_texture( + wgpu::TexelCopyTextureInfo { + texture: &t1, + mip_level: 1, + origin: wgpu::Origin3d::ZERO, + aspect: wgpu::TextureAspect::All, }, - aspect: wgpu::TextureAspect::All, - }, - wgpu::Extent3d { - width: 100, - height: 3, - depth_or_array_layers: 613286111, - }, - ); - ctx.queue.submit(Some(encoder.finish())); - }, - Some("unable to select texture mip level"), - ); -}); + wgpu::TexelCopyTextureInfo { + texture: &t2, + mip_level: 1, + origin: wgpu::Origin3d { + x: 0, + y: 0, + z: 3824276442, + }, + aspect: wgpu::TextureAspect::All, + }, + wgpu::Extent3d { + width: 100, + height: 3, + depth_or_array_layers: 613286111, + }, + ); + ctx.queue.submit(Some(encoder.finish())); + }, + Some("unable to select texture mip level"), + ); + }); diff --git a/tests/tests/wgpu-gpu/transition_resources.rs b/tests/tests/wgpu-gpu/transition_resources.rs index 11f9a04b3..f46e5c9bb 100644 --- a/tests/tests/wgpu-gpu/transition_resources.rs +++ b/tests/tests/wgpu-gpu/transition_resources.rs @@ -1,39 +1,41 @@ -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.push(TRANSITION_RESOURCES); } #[gpu_test] -static TRANSITION_RESOURCES: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| { - let texture = ctx.device.create_texture(&wgpu::TextureDescriptor { - label: None, - size: wgpu::Extent3d { - width: 32, - height: 32, - depth_or_array_layers: 1, - }, - mip_level_count: 1, - sample_count: 1, - dimension: wgpu::TextureDimension::D2, - format: wgpu::TextureFormat::Rgba8Unorm, - usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING, - view_formats: &[], +static TRANSITION_RESOURCES: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_sync(|ctx| { + let texture = ctx.device.create_texture(&wgpu::TextureDescriptor { + label: None, + size: wgpu::Extent3d { + width: 32, + height: 32, + depth_or_array_layers: 1, + }, + mip_level_count: 1, + sample_count: 1, + dimension: wgpu::TextureDimension::D2, + format: wgpu::TextureFormat::Rgba8Unorm, + usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING, + view_formats: &[], + }); + + let mut encoder = ctx + .device + .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); + + encoder.transition_resources( + std::iter::empty(), + [wgpu::TextureTransition { + texture: &texture, + selector: None, + state: wgpu::TextureUses::COLOR_TARGET, + }] + .into_iter(), + ); + + ctx.queue.submit([encoder.finish()]); }); - - let mut encoder = ctx - .device - .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); - - encoder.transition_resources( - std::iter::empty(), - [wgpu::TextureTransition { - texture: &texture, - selector: None, - state: wgpu::TextureUses::COLOR_TARGET, - }] - .into_iter(), - ); - - ctx.queue.submit([encoder.finish()]); -}); diff --git a/tests/tests/wgpu-gpu/write_texture.rs b/tests/tests/wgpu-gpu/write_texture.rs index 5ec343259..2b6ad11e8 100644 --- a/tests/tests/wgpu-gpu/write_texture.rs +++ b/tests/tests/wgpu-gpu/write_texture.rs @@ -1,7 +1,7 @@ //! Tests for texture copy use wgpu::*; -use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer}; +use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters}; pub fn all_tests(vec: &mut Vec) { vec.extend([ @@ -199,8 +199,9 @@ static WRITE_TEXTURE_SUBSET_3D: GpuTestConfiguration = }); #[gpu_test] -static WRITE_TEXTURE_NO_OOB: GpuTestConfiguration = - GpuTestConfiguration::new().run_async(|ctx| async move { +static WRITE_TEXTURE_NO_OOB: GpuTestConfiguration = GpuTestConfiguration::new() + .parameters(TestParameters::default().enable_noop()) + .run_async(|ctx| async move { let size = 256; let tex = ctx.device.create_texture(&wgpu::TextureDescriptor {