From 2bdc54ad32b0dfe081c24e37ed272e8d0f58ddee Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Fri, 2 Jul 2021 00:11:58 -0400 Subject: [PATCH] Formatting woes --- wgpu/examples/hello-compute/tests.rs | 129 ++++++++++++++++----------- wgpu/examples/skybox/main.rs | 2 +- 2 files changed, 79 insertions(+), 52 deletions(-) diff --git a/wgpu/examples/hello-compute/tests.rs b/wgpu/examples/hello-compute/tests.rs index ffb007c24e..2e2ceead65 100644 --- a/wgpu/examples/hello-compute/tests.rs +++ b/wgpu/examples/hello-compute/tests.rs @@ -8,75 +8,102 @@ use common::{initialize_test, TestParameters}; #[test] fn test_compute_1() { - initialize_test(TestParameters::default().specific_failure(Some(wgpu::Backends::GL), None, Some("V3D"), false), |ctx| { - let input = &[1, 2, 3, 4]; + initialize_test( + TestParameters::default().specific_failure( + Some(wgpu::Backends::GL), + None, + Some("V3D"), + false, + ), + |ctx| { + let input = &[1, 2, 3, 4]; - pollster::block_on(assert_execute_gpu( - &ctx.device, - &ctx.queue, - input, - &[0, 1, 7, 2], - )); - }); + pollster::block_on(assert_execute_gpu( + &ctx.device, + &ctx.queue, + input, + &[0, 1, 7, 2], + )); + }, + ); } #[test] fn test_compute_2() { - initialize_test(TestParameters::default().specific_failure(Some(wgpu::Backends::GL), None, Some("V3D"), false), |ctx| { - let input = &[5, 23, 10, 9]; + initialize_test( + TestParameters::default().specific_failure( + Some(wgpu::Backends::GL), + None, + Some("V3D"), + false, + ), + |ctx| { + let input = &[5, 23, 10, 9]; - pollster::block_on(assert_execute_gpu( - &ctx.device, - &ctx.queue, - input, - &[5, 15, 6, 19], - )); - }); + pollster::block_on(assert_execute_gpu( + &ctx.device, + &ctx.queue, + input, + &[5, 15, 6, 19], + )); + }, + ); } #[test] fn test_compute_overflow() { - initialize_test(TestParameters::default().specific_failure(Some(wgpu::Backends::GL), None, Some("V3D"), false), |ctx| { - let input = &[77031, 837799, 8400511, 63728127]; - pollster::block_on(assert_execute_gpu( - &ctx.device, - &ctx.queue, - input, - &[350, 524, OVERFLOW, OVERFLOW], - )); - }); + initialize_test( + TestParameters::default().specific_failure( + Some(wgpu::Backends::GL), + None, + Some("V3D"), + false, + ), + |ctx| { + let input = &[77031, 837799, 8400511, 63728127]; + pollster::block_on(assert_execute_gpu( + &ctx.device, + &ctx.queue, + input, + &[350, 524, OVERFLOW, OVERFLOW], + )); + }, + ); } #[test] fn test_multithreaded_compute() { - initialize_test(TestParameters::default().backend_failures(wgpu::Backends::GL), |ctx| { - use std::{sync::mpsc, thread, time::Duration}; + initialize_test( + TestParameters::default().backend_failures(wgpu::Backends::GL), + |ctx| { + use std::{sync::mpsc, thread, time::Duration}; - let ctx = Arc::new(ctx); + let ctx = Arc::new(ctx); - let thread_count = 8; + let thread_count = 8; - let (tx, rx) = mpsc::channel(); - for _ in 0..thread_count { - let tx = tx.clone(); - let ctx = Arc::clone(&ctx); - thread::spawn(move || { - let input = &[100, 100, 100]; - pollster::block_on(assert_execute_gpu( - &ctx.device, - &ctx.queue, - input, - &[25, 25, 25], - )); - tx.send(true).unwrap(); - }); - } + let (tx, rx) = mpsc::channel(); + for _ in 0..thread_count { + let tx = tx.clone(); + let ctx = Arc::clone(&ctx); + thread::spawn(move || { + let input = &[100, 100, 100]; + pollster::block_on(assert_execute_gpu( + &ctx.device, + &ctx.queue, + input, + &[25, 25, 25], + )); + tx.send(true).unwrap(); + }); + } - for _ in 0..thread_count { - rx.recv_timeout(Duration::from_secs(10)) - .expect("A thread never completed."); - } - }); + for _ in 0..thread_count { + rx.recv_timeout(Duration::from_secs(10)) + .expect("A thread never completed."); + } + }, + ); } async fn assert_execute_gpu( diff --git a/wgpu/examples/skybox/main.rs b/wgpu/examples/skybox/main.rs index c095650e95..98e02f4847 100644 --- a/wgpu/examples/skybox/main.rs +++ b/wgpu/examples/skybox/main.rs @@ -512,7 +512,7 @@ fn skybox_astc() { height: 768, optional_features: wgpu::Features::TEXTURE_COMPRESSION_ASTC_LDR, base_test_parameters: framework::test_common::TestParameters::default(), - tolerance: 5, // TODO + tolerance: 5, // TODO max_outliers: 10, // TODO }); }