Skip to content

Commit

Permalink
Merge #1584
Browse files Browse the repository at this point in the history
1584: Update testing limits for rpi4 r=kvark a=cwfitzgerald

**Connections**

Related to #1574. Exposed #1583.

**Description**

Changes the reftesting limits to be tolerant of how the RPI4 renders. Fixes the debug half of #1577. 

Fixes some naming issues as well.

**Testing**

It is


Co-authored-by: Connor Fitzgerald <[email protected]>
  • Loading branch information
bors[bot] and cwfitzgerald authored Jul 2, 2021
2 parents 579de42 + 2bdc54a commit 871cbed
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 90 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ wgpu features a set of unit, integration, and example based tests. All framework
To run the test suite, run the following command:

```
cargo run --bin wgpu-info -- cargo test
cargo run --bin wgpu-info -- cargo test --no-fail-fast
```

To run any individual test on a specific adapter, populate the following environment variables:
Expand All @@ -51,7 +51,7 @@ To run any individual test on a specific adapter, populate the following environ
Then to run an example's reftests, run:

```
cargo test --example <example-name>
cargo test --example <example-name> --no-fail-fast
```

Or run a part of the integration test suite:
Expand Down
3 changes: 2 additions & 1 deletion wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ impl Inner {
egl::CONTEXT_CLIENT_VERSION,
3, // Request GLES 3.0 or higher
];
if flags.contains(crate::InstanceFlags::DEBUG) && !cfg!(target_os = "android") {
// Debug requires EGL 1.5+
if flags.contains(crate::InstanceFlags::DEBUG) && version >= (1, 5) {
log::info!("\tEGL context: +debug");
//TODO: figure out why this is needed
context_attributes.push(egl::CONTEXT_OPENGL_DEBUG);
Expand Down
1 change: 1 addition & 0 deletions wgpu-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ keywords = ["graphics"]
license = "MIT OR Apache-2.0"

[dependencies]
env_logger = "0.8"
wgpu = { version = "0.9", path = "../wgpu" }
2 changes: 2 additions & 0 deletions wgpu-info/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ fn print_info_from_adapter(adapter: &wgpu::Adapter, idx: usize) {
}

fn main() {
env_logger::init();

let args: Vec<_> = std::env::args().skip(1).collect();

let instance = wgpu::Instance::new(wgpu::Backends::all());
Expand Down
7 changes: 4 additions & 3 deletions wgpu/examples/boids/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ fn boids() {
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 0,
max_outliers: 50,
base_test_parameters: framework::test_common::TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS),
tolerance: 0,
max_outliers: 600, // Currently bounded by rpi4
});
}
2 changes: 1 addition & 1 deletion wgpu/examples/bunnymark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ fn bunnymark() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 1,
tolerance: 1,
max_outliers: 50,
});
}
2 changes: 1 addition & 1 deletion wgpu/examples/conservative-raster/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ fn conservative_raster() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 0,
tolerance: 0,
max_outliers: 0,
});
}
8 changes: 4 additions & 4 deletions wgpu/examples/cube/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ fn cube() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 1,
max_outliers: 3,
tolerance: 1,
max_outliers: 500, // Bounded by rpi4
});
}

Expand All @@ -401,7 +401,7 @@ fn cube_lines() {
height: 768,
optional_features: wgpu::Features::NON_FILL_POLYGON_MODE,
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 2,
max_outliers: 400, // Line rasterization is very different between vendors
tolerance: 2,
max_outliers: 500, // Bounded by rpi4 & intel 620 on GL
});
}
4 changes: 2 additions & 2 deletions wgpu/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ pub struct FrameworkRefTest {
pub height: u32,
pub optional_features: wgpu::Features,
pub base_test_parameters: test_common::TestParameters,
pub tollerance: u8,
pub tolerance: u8,
pub max_outliers: usize,
}

Expand Down Expand Up @@ -472,7 +472,7 @@ pub fn test<E: Example>(mut params: FrameworkRefTest) {
params.width,
params.height,
&bytes,
params.tollerance,
params.tolerance,
params.max_outliers,
);
},
Expand Down
129 changes: 78 additions & 51 deletions wgpu/examples/hello-compute/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,102 @@ use common::{initialize_test, TestParameters};

#[test]
fn test_compute_1() {
initialize_test(TestParameters::default(), |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(), |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(), |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(), |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(
Expand Down
4 changes: 2 additions & 2 deletions wgpu/examples/mipmap/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ fn mipmap() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default()
.backend_failures(wgpu::Backends::VULKAN),
tollerance: 25,
.backend_failures(wgpu::Backends::VULKAN | wgpu::Backends::GL),
tolerance: 25,
max_outliers: 3000, // Mipmap sampling is highly variant between impls. This is currently bounded by AMD on mac
});
}
2 changes: 1 addition & 1 deletion wgpu/examples/msaa-line/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn msaa_line() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 64,
tolerance: 64,
max_outliers: 1 << 16, // MSAA is comically different between vendors, 32k is a decent limit
});
}
7 changes: 4 additions & 3 deletions wgpu/examples/shadow/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,9 @@ fn shadow() {
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 2,
max_outliers: 5,
base_test_parameters: framework::test_common::TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPARISON_SAMPLERS),
tolerance: 2,
max_outliers: 500, // bounded by rpi4
});
}
12 changes: 6 additions & 6 deletions wgpu/examples/skybox/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ fn skybox() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default()
.backend_failures(wgpu::Backends::VULKAN),
tollerance: 2,
.backend_failure(wgpu::Backends::VULKAN | wgpu::Backends::GL),
tolerance: 2,
max_outliers: 3,
});
}
Expand All @@ -486,7 +486,7 @@ fn skybox_bc1() {
height: 768,
optional_features: wgpu::Features::TEXTURE_COMPRESSION_BC,
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 5,
tolerance: 5,
max_outliers: 10,
});
}
Expand All @@ -499,8 +499,8 @@ fn skybox_etc2() {
height: 768,
optional_features: wgpu::Features::TEXTURE_COMPRESSION_ETC2,
base_test_parameters: framework::test_common::TestParameters::default(),
tollerance: 5, // TODO
max_outliers: 10, // TODO
tolerance: 5,
max_outliers: 50, // Bounded by rpi4
});
}

Expand All @@ -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(),
tollerance: 5, // TODO
tolerance: 5, // TODO
max_outliers: 10, // TODO
});
}
8 changes: 4 additions & 4 deletions wgpu/examples/texture-arrays/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ fn texture_arrays_constant() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default().failure(),
tollerance: 0,
tolerance: 0,
max_outliers: 0,
});
}
Expand All @@ -343,7 +343,7 @@ fn texture_arrays_uniform() {
optional_features: wgpu::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING
| wgpu::Features::PUSH_CONSTANTS,
base_test_parameters: framework::test_common::TestParameters::default().failure(),
tollerance: 0,
tolerance: 0,
max_outliers: 0,
});
}
Expand All @@ -357,7 +357,7 @@ fn texture_arrays_non_uniform() {
height: 768,
optional_features: wgpu::Features::SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING,
base_test_parameters: framework::test_common::TestParameters::default().failure(),
tollerance: 0,
tolerance: 0,
max_outliers: 0,
});
}
Expand All @@ -372,7 +372,7 @@ fn texture_arrays_unsized_non_uniform() {
optional_features: wgpu::Features::SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING
| wgpu::Features::UNSIZED_BINDING_ARRAY,
base_test_parameters: framework::test_common::TestParameters::default().failure(),
tollerance: 0,
tolerance: 0,
max_outliers: 0,
});
}
Loading

0 comments on commit 871cbed

Please sign in to comment.