From 1391e239b7fd6164c7e249e41cab78bc00e3b0ad Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Fri, 25 Feb 2022 15:20:05 -0500 Subject: [PATCH] Round up clear texture tests to block size --- wgpu/examples/skybox/main.rs | 21 +++------------------ wgpu/tests/clear_texture.rs | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/wgpu/examples/skybox/main.rs b/wgpu/examples/skybox/main.rs index 53526a02774..de2de44a6a8 100644 --- a/wgpu/examples/skybox/main.rs +++ b/wgpu/examples/skybox/main.rs @@ -490,12 +490,7 @@ fn skybox_bc1() { width: 1024, height: 768, optional_features: wgpu::Features::TEXTURE_COMPRESSION_BC, - base_test_parameters: framework::test_common::TestParameters::default().specific_failure( - Some(wgpu::Backends::GL), - None, - Some("ANGLE"), - false, - ), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 + base_test_parameters: framework::test_common::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 tolerance: 5, max_outliers: 105, // Bounded by llvmpipe }); @@ -508,12 +503,7 @@ fn skybox_etc2() { width: 1024, height: 768, optional_features: wgpu::Features::TEXTURE_COMPRESSION_ETC2, - base_test_parameters: framework::test_common::TestParameters::default().specific_failure( - Some(wgpu::Backends::GL), - None, - Some("ANGLE"), - false, - ), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 + base_test_parameters: framework::test_common::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 tolerance: 5, max_outliers: 105, // Bounded by llvmpipe }); @@ -526,12 +516,7 @@ fn skybox_astc() { width: 1024, height: 768, optional_features: wgpu::Features::TEXTURE_COMPRESSION_ASTC_LDR, - base_test_parameters: framework::test_common::TestParameters::default().specific_failure( - Some(wgpu::Backends::GL), - None, - Some("ANGLE"), - false, - ), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 + base_test_parameters: framework::test_common::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 tolerance: 5, max_outliers: 300, // Bounded by rp4 on vk }); diff --git a/wgpu/tests/clear_texture.rs b/wgpu/tests/clear_texture.rs index 9a15a41274c..976c7acdc47 100644 --- a/wgpu/tests/clear_texture.rs +++ b/wgpu/tests/clear_texture.rs @@ -239,6 +239,10 @@ fn single_texture_clear_test( // TODO: Read back and check zeroness? } +fn round_up(value: u32, alignment: u32) -> u32 { + value + (alignment - (value % alignment)) +} + fn clear_texture_tests( ctx: &TestingContext, formats: &[wgpu::TextureFormat], @@ -246,13 +250,17 @@ fn clear_texture_tests( supports_3d: bool, ) { for &format in formats { + let desc = format.describe(); + let rounded_width = round_up(64, desc.block_dimensions.0 as u32); + let rounded_height = round_up(64, desc.block_dimensions.1 as u32); + // 1D texture if supports_1d { single_texture_clear_test( ctx, format, wgpu::Extent3d { - width: 64, + width: rounded_width, height: 1, depth_or_array_layers: 1, }, @@ -264,8 +272,8 @@ fn clear_texture_tests( ctx, format, wgpu::Extent3d { - width: 64, - height: 64, + width: rounded_width, + height: rounded_height, depth_or_array_layers: 1, }, wgpu::TextureDimension::D2, @@ -275,8 +283,8 @@ fn clear_texture_tests( ctx, format, wgpu::Extent3d { - width: 64, - height: 64, + width: rounded_width, + height: rounded_height, depth_or_array_layers: 4, }, wgpu::TextureDimension::D2, @@ -287,8 +295,8 @@ fn clear_texture_tests( ctx, format, wgpu::Extent3d { - width: 16, - height: 16, + width: rounded_width, + height: rounded_height, depth_or_array_layers: 16, }, wgpu::TextureDimension::D3,