diff --git a/Cargo.lock b/Cargo.lock index 7fce4ca1b..28ba7bab3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2010,6 +2010,7 @@ dependencies = [ name = "wgpu-info" version = "0.9.0" dependencies = [ + "env_logger", "wgpu", ] diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index 10cbff0a0..b164a4bac 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -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); diff --git a/wgpu-info/Cargo.toml b/wgpu-info/Cargo.toml index c0aa877c9..35fe8a9c1 100644 --- a/wgpu-info/Cargo.toml +++ b/wgpu-info/Cargo.toml @@ -10,4 +10,5 @@ keywords = ["graphics"] license = "MIT OR Apache-2.0" [dependencies] +env_logger = "0.8" wgpu = { version = "0.9", path = "../wgpu" } diff --git a/wgpu-info/src/main.rs b/wgpu-info/src/main.rs index 9727a4b27..77fc4777a 100644 --- a/wgpu-info/src/main.rs +++ b/wgpu-info/src/main.rs @@ -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()); diff --git a/wgpu/examples/boids/main.rs b/wgpu/examples/boids/main.rs index ac5751af9..c1eada416 100644 --- a/wgpu/examples/boids/main.rs +++ b/wgpu/examples/boids/main.rs @@ -325,8 +325,9 @@ fn boids() { width: 1024, height: 768, optional_features: wgpu::Features::default(), - base_test_parameters: framework::test_common::TestParameters::default(), + base_test_parameters: framework::test_common::TestParameters::default() + .downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS), tollerance: 0, - max_outliers: 50, + max_outliers: 600, // Currently bounded by rpi4 }); } diff --git a/wgpu/examples/cube/main.rs b/wgpu/examples/cube/main.rs index bcded947a..3c7d52363 100644 --- a/wgpu/examples/cube/main.rs +++ b/wgpu/examples/cube/main.rs @@ -389,7 +389,7 @@ fn cube() { optional_features: wgpu::Features::default(), base_test_parameters: framework::test_common::TestParameters::default(), tollerance: 1, - max_outliers: 3, + max_outliers: 500, // Bounded by rpi4 }); } @@ -402,6 +402,6 @@ fn cube_lines() { 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 + max_outliers: 500, // Bounded by rpi4 & intel 620 on GL }); } diff --git a/wgpu/examples/hello-compute/tests.rs b/wgpu/examples/hello-compute/tests.rs index f0945c5a8..ffb007c24 100644 --- a/wgpu/examples/hello-compute/tests.rs +++ b/wgpu/examples/hello-compute/tests.rs @@ -8,7 +8,7 @@ use common::{initialize_test, TestParameters}; #[test] fn test_compute_1() { - initialize_test(TestParameters::default(), |ctx| { + 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( @@ -22,7 +22,7 @@ fn test_compute_1() { #[test] fn test_compute_2() { - initialize_test(TestParameters::default(), |ctx| { + 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( @@ -36,7 +36,7 @@ fn test_compute_2() { #[test] fn test_compute_overflow() { - initialize_test(TestParameters::default(), |ctx| { + 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, @@ -49,7 +49,7 @@ fn test_compute_overflow() { #[test] fn test_multithreaded_compute() { - initialize_test(TestParameters::default(), |ctx| { + initialize_test(TestParameters::default().backend_failures(wgpu::Backends::GL), |ctx| { use std::{sync::mpsc, thread, time::Duration}; let ctx = Arc::new(ctx); diff --git a/wgpu/examples/mipmap/main.rs b/wgpu/examples/mipmap/main.rs index 22da538b8..1c3031af5 100644 --- a/wgpu/examples/mipmap/main.rs +++ b/wgpu/examples/mipmap/main.rs @@ -483,7 +483,7 @@ fn mipmap() { height: 768, optional_features: wgpu::Features::default(), base_test_parameters: framework::test_common::TestParameters::default() - .backend_failures(wgpu::Backends::VULKAN), + .backend_failures(wgpu::Backends::VULKAN | wgpu::Backends::GL), tollerance: 25, max_outliers: 3000, // Mipmap sampling is highly variant between impls. This is currently bounded by AMD on mac }); diff --git a/wgpu/examples/shadow/main.rs b/wgpu/examples/shadow/main.rs index 2f77b7198..4aed60695 100644 --- a/wgpu/examples/shadow/main.rs +++ b/wgpu/examples/shadow/main.rs @@ -829,8 +829,8 @@ fn shadow() { width: 1024, height: 768, optional_features: wgpu::Features::default(), - base_test_parameters: framework::test_common::TestParameters::default(), + base_test_parameters: framework::test_common::TestParameters::default().downlevel_flags(wgpu::DownlevelFlags::COMPARISON_SAMPLERS), tollerance: 2, - max_outliers: 5, + max_outliers: 500, // bounded by rpi4 }); } diff --git a/wgpu/examples/skybox/main.rs b/wgpu/examples/skybox/main.rs index 4dfb19778..f038576cf 100644 --- a/wgpu/examples/skybox/main.rs +++ b/wgpu/examples/skybox/main.rs @@ -472,7 +472,7 @@ fn skybox() { height: 768, optional_features: wgpu::Features::default(), base_test_parameters: framework::test_common::TestParameters::default() - .backend_failures(wgpu::Backends::VULKAN), + .backend_failures(wgpu::Backends::VULKAN | wgpu::Backends::GL), tollerance: 2, max_outliers: 3, }); @@ -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 + tollerance: 5, + max_outliers: 50, // Bounded by rpi4 }); } diff --git a/wgpu/examples/water/main.rs b/wgpu/examples/water/main.rs index c18d5c194..7aa4ee02c 100644 --- a/wgpu/examples/water/main.rs +++ b/wgpu/examples/water/main.rs @@ -791,13 +791,13 @@ fn main() { } #[test] -fn shadow() { +fn water() { framework::test::(framework::FrameworkRefTest { image_path: "/examples/water/screenshot.png", width: 1024, height: 768, optional_features: wgpu::Features::default(), - base_test_parameters: framework::test_common::TestParameters::default(), + base_test_parameters: framework::test_common::TestParameters::default().downlevel_flags(wgpu::DownlevelFlags::READ_ONLY_DEPTH_STENCIL), tollerance: 5, max_outliers: 10, }); diff --git a/wgpu/tests/common/mod.rs b/wgpu/tests/common/mod.rs index 05d320d00..0ca48e71a 100644 --- a/wgpu/tests/common/mod.rs +++ b/wgpu/tests/common/mod.rs @@ -5,7 +5,7 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; use wgt::{Backends, DeviceDescriptor, DownlevelCapabilities, Features, Limits}; -use wgpu::{util, Adapter, Device, Instance, Queue}; +use wgpu::{util, Adapter, Device, DownlevelFlags, Instance, Queue}; pub mod image; @@ -119,6 +119,11 @@ impl TestParameters { self } + pub fn downlevel_flags(mut self, downlevel_flags: DownlevelFlags) -> Self { + self.required_downlevel_properties.flags |= downlevel_flags; + self + } + /// Mark the test as always failing, equivilant to specific_failure(None, None, None) pub fn failure(mut self) -> Self { self.failures.push((None, None, None, false));