Make screenshots pass on laptop

This commit is contained in:
Connor Fitzgerald 2021-06-20 03:20:21 -04:00
parent ec74722d57
commit d094712cd4
7 changed files with 14 additions and 14 deletions

View File

@ -361,7 +361,7 @@ fn bunnymark() {
768,
wgpu::Features::default(),
framework::test_common::TestParameters::default(),
0,
1,
50,
);
}

View File

@ -404,7 +404,7 @@ fn cube_lines() {
768,
wgpu::Features::NON_FILL_POLYGON_MODE,
framework::test_common::TestParameters::default(),
1,
3,
2,
400, // Line rasterization is very different between vendors
);
}

View File

@ -486,7 +486,7 @@ fn mipmap() {
768,
wgpu::Features::default(),
framework::test_common::TestParameters::default(),
15, // Mipmap sampling is highly variant between impls. This is currently bounded by the M1
40,
25, // Mipmap sampling is highly variant between impls. This is currently bounded by an 620
100,
);
}

View File

@ -487,7 +487,7 @@ fn skybox_bc1() {
768,
wgpu::Features::TEXTURE_COMPRESSION_BC,
framework::test_common::TestParameters::default(),
4,
5,
0,
);
}
@ -503,8 +503,8 @@ fn skybox_etc2() {
768,
wgpu::Features::TEXTURE_COMPRESSION_ETC2,
framework::test_common::TestParameters::default(),
1, // TODO
1, // TODO
5, // TODO
0, // TODO
);
}
@ -519,7 +519,7 @@ fn skybox_astc() {
768,
wgpu::Features::TEXTURE_COMPRESSION_ASTC_LDR,
framework::test_common::TestParameters::default(),
1, // TODO
1, // TODO
5, // TODO
0, // TODO
);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

View File

@ -43,13 +43,13 @@ fn read_png(path: impl AsRef<Path>, width: u32, height: u32) -> Option<Vec<u8>>
Some(buffer)
}
fn write_png(path: impl AsRef<Path>, width: u32, height: u32, data: &[u8]) {
fn write_png(path: impl AsRef<Path>, width: u32, height: u32, data: &[u8], compression: png::Compression) {
let file = BufWriter::new(File::create(path).unwrap());
let mut encoder = png::Encoder::new(file, width, height);
encoder.set_color(png::ColorType::RGBA);
encoder.set_depth(png::BitDepth::Eight);
encoder.set_compression(png::Compression::Best);
encoder.set_compression(compression);
let mut writer = encoder.write_header().unwrap();
writer.write_image_data(&data).unwrap();
@ -110,7 +110,7 @@ pub fn compare_image_output(
.unwrap(),
);
write_png(&difference_path, width, height, &difference_data);
write_png(&difference_path, width, height, &difference_data, png::Compression::Fast);
panic!("Image data mismatch! Outlier count {} over limit {}. Max difference {}", outliers, max_outliers, max_difference)
} else {
@ -120,6 +120,6 @@ pub fn compare_image_output(
);
}
} else {
write_png(&path, width, height, data);
write_png(&path, width, height, data, png::Compression::Best);
}
}