mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Use explicit test enumeration
This commit is contained in:
parent
86d5211f84
commit
09d0c94576
@ -248,4 +248,4 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod tests;
|
||||
pub mod tests;
|
||||
|
||||
@ -2,7 +2,7 @@ use super::*;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
|
||||
#[gpu_test]
|
||||
static TWO_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
pub static TWO_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
TestParameters::default()
|
||||
.features(
|
||||
|
||||
@ -323,7 +323,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "boids",
|
||||
// Generated on 1080ti on Vk/Windows
|
||||
image_path: "/examples/features/src/boids/screenshot.png",
|
||||
|
||||
@ -434,7 +434,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "bunnymark",
|
||||
image_path: "/examples/features/src/bunnymark/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -317,7 +317,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "conservative-raster",
|
||||
image_path: "/examples/features/src/conservative_raster/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -381,7 +381,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "cube",
|
||||
// Generated on 1080ti on Vk/Windows
|
||||
image_path: "/examples/features/src/cube/screenshot.png",
|
||||
@ -397,7 +397,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_LINES: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_LINES: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "cube-lines",
|
||||
// Generated on 1080ti on Vk/Windows
|
||||
image_path: "/examples/features/src/cube/screenshot-lines.png",
|
||||
|
||||
@ -208,4 +208,4 @@ pub fn main() {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
pub mod tests;
|
||||
|
||||
@ -2,7 +2,7 @@ use super::*;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
|
||||
#[gpu_test]
|
||||
static SYNC: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
pub static SYNC: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
// Taken from hello-compute tests.
|
||||
TestParameters::default()
|
||||
|
||||
@ -36,4 +36,52 @@ pub mod uniform_values;
|
||||
pub mod water;
|
||||
|
||||
#[cfg(test)]
|
||||
wgpu_test::gpu_test_main!();
|
||||
fn all_tests() -> Vec<wgpu_test::GpuTestInitializer> {
|
||||
#[cfg_attr(
|
||||
target_arch = "wasm32",
|
||||
expect(unused_mut, reason = "non-wasm32 needs this mutable")
|
||||
)]
|
||||
let mut test_list = vec![
|
||||
boids::TEST,
|
||||
bunnymark::TEST,
|
||||
conservative_raster::TEST,
|
||||
cube::TEST,
|
||||
cube::TEST_LINES,
|
||||
hello_synchronization::tests::SYNC,
|
||||
mipmap::TEST,
|
||||
mipmap::TEST_QUERY,
|
||||
msaa_line::TEST,
|
||||
multiple_render_targets::TEST,
|
||||
ray_cube_compute::TEST,
|
||||
ray_cube_fragment::TEST,
|
||||
ray_cube_normals::TEST,
|
||||
ray_scene::TEST,
|
||||
ray_shadows::TEST,
|
||||
ray_traced_triangle::TEST,
|
||||
shadow::TEST,
|
||||
skybox::TEST,
|
||||
skybox::TEST_ASTC,
|
||||
skybox::TEST_BCN,
|
||||
skybox::TEST_ETC2,
|
||||
srgb_blend::TEST_LINEAR,
|
||||
srgb_blend::TEST_SRGB,
|
||||
stencil_triangles::TEST,
|
||||
texture_arrays::TEST,
|
||||
texture_arrays::TEST_NON_UNIFORM,
|
||||
texture_arrays::TEST_UNIFORM,
|
||||
timestamp_queries::tests::TIMESTAMPS_ENCODER,
|
||||
timestamp_queries::tests::TIMESTAMPS_PASSES,
|
||||
timestamp_queries::tests::TIMESTAMPS_PASS_BOUNDARIES,
|
||||
water::TEST,
|
||||
];
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
test_list.push(big_compute_buffers::tests::TWO_BUFFERS);
|
||||
}
|
||||
|
||||
test_list
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
wgpu_test::gpu_test_main!(all_tests());
|
||||
|
||||
@ -508,7 +508,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "mipmap",
|
||||
image_path: "/examples/features/src/mipmap/screenshot.png",
|
||||
width: 1024,
|
||||
@ -521,7 +521,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_QUERY: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_QUERY: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "mipmap-query",
|
||||
image_path: "/examples/features/src/mipmap/screenshot_query.png",
|
||||
width: 1024,
|
||||
|
||||
@ -321,7 +321,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "msaa-line",
|
||||
image_path: "/examples/features/src/msaa_line/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -536,7 +536,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: EXAMPLE_NAME,
|
||||
image_path: "/examples/features/src/multiple_render_targets/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -486,7 +486,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "ray_cube_compute",
|
||||
image_path: "/examples/features/src/ray_cube_compute/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -372,7 +372,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "ray_cube_fragment",
|
||||
image_path: "/examples/features/src/ray_cube_fragment/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -472,7 +472,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "ray_cube_normals",
|
||||
image_path: "/examples/features/src/ray_cube_normals/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -552,7 +552,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "ray_scene",
|
||||
image_path: "/examples/features/src/ray_scene/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -370,7 +370,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "ray_shadows",
|
||||
image_path: "/examples/features/src/ray_shadows/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -431,7 +431,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "ray_traced_triangle",
|
||||
image_path: "/examples/features/src/ray_traced_triangle/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -839,7 +839,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "shadow",
|
||||
image_path: "/examples/features/src/shadow/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -470,7 +470,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "skybox",
|
||||
image_path: "/examples/features/src/skybox/screenshot.png",
|
||||
width: 1024,
|
||||
@ -485,7 +485,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_BCN: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_BCN: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "skybox-bc7",
|
||||
image_path: "/examples/features/src/skybox/screenshot_bc7.png",
|
||||
width: 1024,
|
||||
@ -498,7 +498,7 @@ static TEST_BCN: crate::framework::ExampleTestParams = crate::framework::Example
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_ETC2: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_ETC2: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "skybox-etc2",
|
||||
image_path: "/examples/features/src/skybox/screenshot_etc2.png",
|
||||
width: 1024,
|
||||
@ -511,7 +511,7 @@ static TEST_ETC2: crate::framework::ExampleTestParams = crate::framework::Exampl
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_ASTC: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_ASTC: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "skybox-astc",
|
||||
image_path: "/examples/features/src/skybox/screenshot_astc.png",
|
||||
width: 1024,
|
||||
|
||||
@ -223,7 +223,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_SRGB: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_SRGB: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "srgb-blend-srg",
|
||||
// Generated on WARP/Windows
|
||||
image_path: "/examples/features/src/srgb_blend/screenshot-srgb.png",
|
||||
@ -237,7 +237,7 @@ static TEST_SRGB: crate::framework::ExampleTestParams = crate::framework::Exampl
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_LINEAR: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST_LINEAR: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "srgb-blend-linear",
|
||||
// Generated on WARP/Windows
|
||||
image_path: "/examples/features/src/srgb_blend/screenshot-linear.png",
|
||||
|
||||
@ -245,7 +245,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "stencil-triangles",
|
||||
image_path: "/examples/features/src/stencil_triangles/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -431,7 +431,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "texture-arrays",
|
||||
image_path: "/examples/features/src/texture_arrays/screenshot.png",
|
||||
width: 1024,
|
||||
@ -444,20 +444,21 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_UNIFORM: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "texture-arrays-uniform",
|
||||
image_path: "/examples/features/src/texture_arrays/screenshot.png",
|
||||
width: 1024,
|
||||
height: 768,
|
||||
optional_features: wgpu::Features::empty(),
|
||||
base_test_parameters: wgpu_test::TestParameters::default(),
|
||||
comparisons: &[wgpu_test::ComparisonType::Mean(0.0)],
|
||||
_phantom: std::marker::PhantomData::<Example>,
|
||||
};
|
||||
pub static TEST_UNIFORM: crate::framework::ExampleTestParams =
|
||||
crate::framework::ExampleTestParams {
|
||||
name: "texture-arrays-uniform",
|
||||
image_path: "/examples/features/src/texture_arrays/screenshot.png",
|
||||
width: 1024,
|
||||
height: 768,
|
||||
optional_features: wgpu::Features::empty(),
|
||||
base_test_parameters: wgpu_test::TestParameters::default(),
|
||||
comparisons: &[wgpu_test::ComparisonType::Mean(0.0)],
|
||||
_phantom: std::marker::PhantomData::<Example>,
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST_NON_UNIFORM: crate::framework::ExampleTestParams =
|
||||
pub static TEST_NON_UNIFORM: crate::framework::ExampleTestParams =
|
||||
crate::framework::ExampleTestParams {
|
||||
name: "texture-arrays-non-uniform",
|
||||
image_path: "/examples/features/src/texture_arrays/screenshot.png",
|
||||
|
||||
@ -426,13 +426,13 @@ pub fn main() {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
pub mod tests {
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration};
|
||||
|
||||
use super::{submit_render_and_compute_pass_with_queries, QueryResults};
|
||||
|
||||
#[gpu_test]
|
||||
static TIMESTAMPS_PASS_BOUNDARIES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
pub static TIMESTAMPS_PASS_BOUNDARIES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
wgpu_test::TestParameters::default()
|
||||
.limits(wgpu::Limits::downlevel_defaults())
|
||||
@ -441,7 +441,7 @@ mod tests {
|
||||
.run_sync(|ctx| test_timestamps(ctx, false, false));
|
||||
|
||||
#[gpu_test]
|
||||
static TIMESTAMPS_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
pub static TIMESTAMPS_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
wgpu_test::TestParameters::default()
|
||||
.limits(wgpu::Limits::downlevel_defaults())
|
||||
@ -455,7 +455,7 @@ mod tests {
|
||||
.run_sync(|ctx| test_timestamps(ctx, true, false));
|
||||
|
||||
#[gpu_test]
|
||||
static TIMESTAMPS_PASSES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
pub static TIMESTAMPS_PASSES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
wgpu_test::TestParameters::default()
|
||||
.limits(wgpu::Limits::downlevel_defaults())
|
||||
|
||||
@ -823,7 +823,7 @@ pub fn main() {
|
||||
|
||||
#[cfg(test)]
|
||||
#[wgpu_test::gpu_test]
|
||||
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
pub static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
|
||||
name: "water",
|
||||
image_path: "/examples/features/src/water/screenshot.png",
|
||||
width: 1024,
|
||||
|
||||
@ -118,3 +118,5 @@ impl Default for GpuTestConfiguration {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub type GpuTestInitializer = fn() -> GpuTestConfiguration;
|
||||
|
||||
@ -17,7 +17,7 @@ mod run;
|
||||
pub use init::initialize_html_canvas;
|
||||
|
||||
pub use self::image::ComparisonType;
|
||||
pub use config::GpuTestConfiguration;
|
||||
pub use config::{GpuTestConfiguration, GpuTestInitializer};
|
||||
#[doc(hidden)]
|
||||
pub use ctor;
|
||||
pub use expectations::{FailureApplicationReasons, FailureBehavior, FailureCase, FailureReason};
|
||||
@ -114,17 +114,22 @@ pub fn did_oom<T>(device: &wgpu::Device, callback: impl FnOnce() -> T) -> (bool,
|
||||
}
|
||||
|
||||
/// Adds the necessary main function for our gpu test harness.
|
||||
///
|
||||
/// Takes a single argument which is an expression that evaluates to `Vec<wgpu_test::GpuTestInitializer>`.
|
||||
#[macro_export]
|
||||
macro_rules! gpu_test_main {
|
||||
() => {
|
||||
($tests: expr) => {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn main() {}
|
||||
fn main() {
|
||||
// Ensure that value is used so that warnings don't happen.
|
||||
let _ = $tests;
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn main() -> $crate::native::MainResult {
|
||||
$crate::native::main()
|
||||
$crate::native::main($tests)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ use parking_lot::Mutex;
|
||||
|
||||
use crate::{
|
||||
config::GpuTestConfiguration, params::TestInfo, report::AdapterReport, run::execute_test,
|
||||
GpuTestInitializer,
|
||||
};
|
||||
|
||||
type NativeTestFuture = Pin<Box<dyn Future<Output = ()> + Send>>;
|
||||
@ -76,7 +77,7 @@ pub static TEST_LIST: Mutex<Vec<crate::GpuTestConfiguration>> = Mutex::new(Vec::
|
||||
pub type MainResult = anyhow::Result<()>;
|
||||
|
||||
/// Main function that runs every gpu function once for every adapter on the system.
|
||||
pub fn main() -> MainResult {
|
||||
pub fn main(tests: Vec<GpuTestInitializer>) -> MainResult {
|
||||
use anyhow::Context;
|
||||
|
||||
use crate::report::GpuReport;
|
||||
@ -108,9 +109,9 @@ pub fn main() -> MainResult {
|
||||
report
|
||||
};
|
||||
|
||||
let mut test_guard = TEST_LIST.lock();
|
||||
// Iterate through all the tests. Creating a test per adapter.
|
||||
execute_native(test_guard.drain(..).flat_map(|test| {
|
||||
execute_native(tests.into_iter().flat_map(|initializer| {
|
||||
let test = initializer();
|
||||
report
|
||||
.devices
|
||||
.iter()
|
||||
|
||||
@ -2,7 +2,11 @@
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(BGRA8_UNORM_STORAGE);
|
||||
}
|
||||
|
||||
const SHADER_SRC: &str = "
|
||||
@group(0) @binding(0) var tex: texture_storage_2d<bgra8unorm, write>;
|
||||
|
||||
@ -1,6 +1,19 @@
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
BIND_GROUP_LAYOUT_DEDUPLICATION,
|
||||
BIND_GROUP_LAYOUT_DEDUPLICATION_WITH_DROPPED_USER_HANDLE,
|
||||
GET_DERIVED_BGL,
|
||||
SEPARATE_PIPELINES_HAVE_INCOMPATIBLE_DERIVED_BGLS,
|
||||
DERIVED_BGLS_INCOMPATIBLE_WITH_REGULAR_BGLS,
|
||||
BIND_GROUP_LAYOUT_DEDUPLICATION_DERIVED,
|
||||
]);
|
||||
}
|
||||
|
||||
const SHADER_SRC: &str = "
|
||||
@group(0) @binding(0)
|
||||
|
||||
@ -1,7 +1,19 @@
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use wgpu::{BufferUsages, PollType};
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
MULTIPLE_BINDINGS_WITH_DIFFERENT_SIZES,
|
||||
BIND_GROUP_NONFILTERING_LAYOUT_NONFILTERING_SAMPLER,
|
||||
BIND_GROUP_NONFILTERING_LAYOUT_MIN_SAMPLER,
|
||||
BIND_GROUP_NONFILTERING_LAYOUT_MAG_SAMPLER,
|
||||
BIND_GROUP_NONFILTERING_LAYOUT_MIPMAP_SAMPLER,
|
||||
]);
|
||||
}
|
||||
|
||||
/// Create two bind groups against the same bind group layout, in the same
|
||||
/// compute pass, but against two different shaders that have different binding
|
||||
|
||||
@ -1,7 +1,18 @@
|
||||
use std::num::{NonZeroU32, NonZeroU64};
|
||||
|
||||
use wgpu::*;
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
BINDING_ARRAY_UNIFORM_BUFFERS,
|
||||
PARTIAL_BINDING_ARRAY_UNIFORM_BUFFERS,
|
||||
BINDING_ARRAY_STORAGE_BUFFERS,
|
||||
PARTIAL_BINDING_ARRAY_STORAGE_BUFFERS,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BINDING_ARRAY_UNIFORM_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -2,3 +2,10 @@ mod buffers;
|
||||
mod sampled_textures;
|
||||
mod samplers;
|
||||
mod storage_textures;
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
buffers::all_tests(tests);
|
||||
sampled_textures::all_tests(tests);
|
||||
samplers::all_tests(tests);
|
||||
storage_textures::all_tests(tests);
|
||||
}
|
||||
|
||||
@ -2,9 +2,17 @@ use std::num::NonZeroU32;
|
||||
|
||||
use wgpu::*;
|
||||
use wgpu_test::{
|
||||
gpu_test, image::ReadbackBuffers, GpuTestConfiguration, TestParameters, TestingContext,
|
||||
gpu_test, image::ReadbackBuffers, GpuTestConfiguration, GpuTestInitializer, TestParameters,
|
||||
TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
BINDING_ARRAY_SAMPLED_TEXTURES,
|
||||
PARTIAL_BINDING_ARRAY_SAMPLED_TEXTURES,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BINDING_ARRAY_SAMPLED_TEXTURES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
use std::num::{NonZeroU32, NonZeroU64};
|
||||
|
||||
use wgpu::*;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([BINDING_ARRAY_SAMPLERS, PARTIAL_BINDING_ARRAY_SAMPLERS]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BINDING_ARRAY_SAMPLERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -2,10 +2,17 @@ use std::num::NonZeroU32;
|
||||
|
||||
use wgpu::*;
|
||||
use wgpu_test::{
|
||||
gpu_test, image::ReadbackBuffers, FailureCase, GpuTestConfiguration, TestParameters,
|
||||
TestingContext,
|
||||
gpu_test, image::ReadbackBuffers, FailureCase, GpuTestConfiguration, GpuTestInitializer,
|
||||
TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
BINDING_ARRAY_STORAGE_TEXTURES,
|
||||
PARTIAL_BINDING_ARRAY_STORAGE_TEXTURES,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BINDING_ARRAY_STORAGE_TEXTURES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -1,4 +1,17 @@
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
EMPTY_BUFFER,
|
||||
MAP_OFFSET,
|
||||
MINIMUM_BUFFER_BINDING_SIZE_LAYOUT,
|
||||
MINIMUM_BUFFER_BINDING_SIZE_DISPATCH,
|
||||
CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS,
|
||||
CLEAR_OFFSET_PLUS_SIZE_OUTSIDE_U64_BOUNDS,
|
||||
]);
|
||||
}
|
||||
|
||||
async fn test_empty_buffer_range(ctx: &TestingContext, buffer_size: u64, label: &str) {
|
||||
let r = wgpu::BufferUsages::MAP_READ;
|
||||
|
||||
@ -2,7 +2,11 @@
|
||||
|
||||
use wgpu::BufferAddress;
|
||||
|
||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(COPY_ALIGNMENT);
|
||||
}
|
||||
|
||||
fn try_copy(
|
||||
ctx: &wgpu_test::TestingContext,
|
||||
|
||||
@ -2,7 +2,17 @@
|
||||
|
||||
use wgpu::BufferAddress;
|
||||
use wgpu::{BufferUsages as Bu, MapMode as Ma};
|
||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
BUFFER_USAGE,
|
||||
BUFFER_USAGE_MAPPABLE_PRIMARY_BUFFERS,
|
||||
BUFFER_MAP_ASYNC_MAP_STATE,
|
||||
]);
|
||||
}
|
||||
|
||||
const BUFFER_SIZE: BufferAddress = 1234;
|
||||
|
||||
|
||||
@ -1,8 +1,20 @@
|
||||
use wgpu_test::{
|
||||
gpu_test, image::ReadbackBuffers, FailureCase, GpuTestConfiguration, TestParameters,
|
||||
TestingContext,
|
||||
gpu_test, image::ReadbackBuffers, FailureCase, GpuTestConfiguration, GpuTestInitializer,
|
||||
TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
CLEAR_TEXTURE_UNCOMPRESSED_GLES,
|
||||
CLEAR_TEXTURE_UNCOMPRESSED,
|
||||
CLEAR_TEXTURE_DEPTH,
|
||||
CLEAR_TEXTURE_DEPTH32_STENCIL8,
|
||||
CLEAR_TEXTURE_COMPRESSED_BCN,
|
||||
CLEAR_TEXTURE_COMPRESSED_ASTC,
|
||||
CLEAR_TEXTURE_COMPRESSED_ETC2,
|
||||
]);
|
||||
}
|
||||
|
||||
static TEXTURE_FORMATS_UNCOMPRESSED_GLES_COMPAT: &[wgpu::TextureFormat] = &[
|
||||
wgpu::TextureFormat::R8Unorm,
|
||||
wgpu::TextureFormat::R8Snorm,
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(CLIP_DISTANCES);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static CLIP_DISTANCES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
use wgpu_test::{gpu_test, TestingContext};
|
||||
use wgpu_test::{gpu_test, GpuTestInitializer, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(CLONEABLE_BUFFERS);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static CLONEABLE_BUFFERS: GpuTestConfiguration =
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use wgpu::util::DeviceExt as _;
|
||||
use wgpu_test::{gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, valid, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
COMPUTE_PASS_RESOURCE_OWNERSHIP,
|
||||
COMPUTE_PASS_QUERY_SET_OWNERSHIP_PIPELINE_STATISTICS,
|
||||
COMPUTE_PASS_QUERY_SET_OWNERSHIP_TIMESTAMPS,
|
||||
COMPUTE_PASS_KEEP_ENCODER_ALIVE,
|
||||
]);
|
||||
}
|
||||
|
||||
const SHADER_SRC: &str = "
|
||||
@group(0) @binding(0)
|
||||
|
||||
@ -1,6 +1,28 @@
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
CROSS_DEVICE_BIND_GROUP_USAGE,
|
||||
DEVICE_DESTROY_THEN_MORE,
|
||||
DEVICE_DESTROY_THEN_LOST,
|
||||
DIFFERENT_BGL_ORDER_BW_SHADER_AND_API,
|
||||
DEVICE_DESTROY_THEN_BUFFER_CLEANUP,
|
||||
DEVICE_AND_QUEUE_HAVE_DIFFERENT_IDS,
|
||||
]);
|
||||
|
||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
|
||||
{
|
||||
vec.extend([
|
||||
DEVICE_LIFETIME_CHECK,
|
||||
MULTIPLE_DEVICES,
|
||||
REQUEST_DEVICE_ERROR_MESSAGE_NATIVE,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static CROSS_DEVICE_BIND_GROUP_USAGE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,4 +1,15 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
NUM_WORKGROUPS_BUILTIN,
|
||||
DISCARD_DISPATCH,
|
||||
RESET_BIND_GROUPS,
|
||||
ZERO_SIZED_BUFFER,
|
||||
]);
|
||||
}
|
||||
|
||||
/// Make sure that the num_workgroups builtin works properly (it requires a workaround on D3D12).
|
||||
#[gpu_test]
|
||||
|
||||
@ -2,7 +2,33 @@ use wgpu::{
|
||||
util::{BufferInitDescriptor, DeviceExt},
|
||||
vertex_attr_array,
|
||||
};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend(&[
|
||||
DRAW,
|
||||
DRAW_OOB_START,
|
||||
DRAW_OOB_COUNT,
|
||||
INSTANCED_DRAW,
|
||||
INSTANCED_DRAW_OOB_START,
|
||||
INSTANCED_DRAW_OOB_COUNT,
|
||||
INSTANCED_DRAW_OOB_INSTANCE_START,
|
||||
INSTANCED_DRAW_OOB_INSTANCE_COUNT,
|
||||
INSTANCED_DRAW_WITH_NON_ZERO_FIRST_INSTANCE,
|
||||
INSTANCED_DRAW_WITH_NON_ZERO_FIRST_INSTANCE_MISSING_FEATURE,
|
||||
INDEXED_DRAW,
|
||||
INDEXED_DRAW_OOB_START,
|
||||
INDEXED_DRAW_OOB_COUNT,
|
||||
INSTANCED_INDEXED_DRAW,
|
||||
INSTANCED_INDEXED_DRAW_OOB_START,
|
||||
INSTANCED_INDEXED_DRAW_OOB_COUNT,
|
||||
INSTANCED_INDEXED_DRAW_OOB_INSTANCE_START,
|
||||
INSTANCED_INDEXED_DRAW_OOB_INSTANCE_COUNT,
|
||||
INDIRECT_BUFFER_OFFSETS,
|
||||
]);
|
||||
}
|
||||
|
||||
struct TestData {
|
||||
kind: Kind,
|
||||
|
||||
@ -1,5 +1,14 @@
|
||||
use wgpu::*;
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
DUAL_SOURCE_BLENDING_FEATURE_DISABLED,
|
||||
DUAL_SOURCE_BLENDING_FEATURE_ENABLED,
|
||||
]);
|
||||
}
|
||||
|
||||
const VERTEX_SHADER: &str = r#"
|
||||
@vertex
|
||||
|
||||
@ -1,9 +1,19 @@
|
||||
use wgpu::util::DeviceExt;
|
||||
use wgpu::CommandEncoder;
|
||||
use wgpu_test::{
|
||||
fail, gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext,
|
||||
fail, gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters,
|
||||
TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
DROP_ENCODER,
|
||||
DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER,
|
||||
DROP_ENCODER_AFTER_ERROR,
|
||||
ENCODER_OPERATIONS_FAIL_WHILE_PASS_ALIVE,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static DROP_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
||||
let encoder = ctx
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
//! Tests for FLOAT32_FILTERABLE feature.
|
||||
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
FLOAT32_FILTERABLE_WITHOUT_FEATURE,
|
||||
FLOAT32_FILTERABLE_WITH_FEATURE,
|
||||
]);
|
||||
}
|
||||
|
||||
fn create_texture_binding(device: &wgpu::Device, format: wgpu::TextureFormat, filterable: bool) {
|
||||
let texture = device.create_texture(&wgpu::TextureDescriptor {
|
||||
|
||||
@ -2,9 +2,19 @@
|
||||
|
||||
use wgpu::ShaderModuleDescriptor;
|
||||
use wgpu_test::{
|
||||
fail, gpu_test, image::ReadbackBuffers, GpuTestConfiguration, TestParameters, TestingContext,
|
||||
fail, gpu_test, image::ReadbackBuffers, GpuTestConfiguration, GpuTestInitializer,
|
||||
TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
IMAGE_64_ATOMICS,
|
||||
IMAGE_32_ATOMICS,
|
||||
IMAGE_ATOMICS_NOT_ENABLED,
|
||||
IMAGE_ATOMICS_NOT_SUPPORTED,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static IMAGE_64_ATOMICS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(INITIALIZE);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static INITIALIZE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|_ctx| {});
|
||||
|
||||
@ -1,5 +1,16 @@
|
||||
use wgpu::{util::DeviceExt, Backends};
|
||||
use wgpu_test::{fail, gpu_test, FailureCase, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{
|
||||
fail, gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
BUFFER_DESTROY,
|
||||
TEXTURE_DESTROY,
|
||||
BUFFER_DESTROY_BEFORE_SUBMIT,
|
||||
TEXTURE_DESTROY_BEFORE_SUBMIT,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BUFFER_DESTROY: GpuTestConfiguration =
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
mod regression {
|
||||
mod issue_3349;
|
||||
mod issue_3457;
|
||||
mod issue_4024;
|
||||
mod issue_4122;
|
||||
mod issue_4485;
|
||||
mod issue_4514;
|
||||
mod issue_5553;
|
||||
mod issue_6317;
|
||||
mod issue_6467;
|
||||
mod issue_6827;
|
||||
pub mod issue_3349;
|
||||
pub mod issue_3457;
|
||||
pub mod issue_4024;
|
||||
pub mod issue_4122;
|
||||
pub mod issue_4485;
|
||||
pub mod issue_4514;
|
||||
pub mod issue_5553;
|
||||
pub mod issue_6317;
|
||||
pub mod issue_6467;
|
||||
pub mod issue_6827;
|
||||
}
|
||||
|
||||
mod bgra8unorm_storage;
|
||||
@ -69,4 +69,76 @@ mod vertex_indices;
|
||||
mod write_texture;
|
||||
mod zero_init_texture_after_discard;
|
||||
|
||||
wgpu_test::gpu_test_main!();
|
||||
fn all_tests() -> Vec<wgpu_test::GpuTestInitializer> {
|
||||
let mut tests = Vec::new();
|
||||
|
||||
bgra8unorm_storage::all_tests(&mut tests);
|
||||
bind_group_layout_dedup::all_tests(&mut tests);
|
||||
bind_groups::all_tests(&mut tests);
|
||||
binding_array::all_tests(&mut tests);
|
||||
buffer_copy::all_tests(&mut tests);
|
||||
buffer_usages::all_tests(&mut tests);
|
||||
buffer::all_tests(&mut tests);
|
||||
clear_texture::all_tests(&mut tests);
|
||||
clip_distances::all_tests(&mut tests);
|
||||
cloneable_types::all_tests(&mut tests);
|
||||
compute_pass_ownership::all_tests(&mut tests);
|
||||
device::all_tests(&mut tests);
|
||||
dispatch_workgroups_indirect::all_tests(&mut tests);
|
||||
draw_indirect::all_tests(&mut tests);
|
||||
dual_source_blending::all_tests(&mut tests);
|
||||
encoder::all_tests(&mut tests);
|
||||
float32_filterable::all_tests(&mut tests);
|
||||
image_atomics::all_tests(&mut tests);
|
||||
instance::all_tests(&mut tests);
|
||||
life_cycle::all_tests(&mut tests);
|
||||
mem_leaks::all_tests(&mut tests);
|
||||
mesh_shader::all_tests(&mut tests);
|
||||
nv12_texture::all_tests(&mut tests);
|
||||
occlusion_query::all_tests(&mut tests);
|
||||
oob_indexing::all_tests(&mut tests);
|
||||
oom::all_tests(&mut tests);
|
||||
pipeline_cache::all_tests(&mut tests);
|
||||
pipeline::all_tests(&mut tests);
|
||||
poll::all_tests(&mut tests);
|
||||
push_constants::all_tests(&mut tests);
|
||||
query_set::all_tests(&mut tests);
|
||||
queue_transfer::all_tests(&mut tests);
|
||||
ray_tracing::all_tests(&mut tests);
|
||||
regression::issue_3349::all_tests(&mut tests);
|
||||
regression::issue_3457::all_tests(&mut tests);
|
||||
regression::issue_4024::all_tests(&mut tests);
|
||||
regression::issue_4122::all_tests(&mut tests);
|
||||
regression::issue_4485::all_tests(&mut tests);
|
||||
regression::issue_4514::all_tests(&mut tests);
|
||||
regression::issue_5553::all_tests(&mut tests);
|
||||
regression::issue_6317::all_tests(&mut tests);
|
||||
regression::issue_6467::all_tests(&mut tests);
|
||||
regression::issue_6827::all_tests(&mut tests);
|
||||
render_pass_ownership::all_tests(&mut tests);
|
||||
render_target::all_tests(&mut tests);
|
||||
resource_descriptor_accessor::all_tests(&mut tests);
|
||||
resource_error::all_tests(&mut tests);
|
||||
samplers::all_tests(&mut tests);
|
||||
scissor_tests::all_tests(&mut tests);
|
||||
shader_primitive_index::all_tests(&mut tests);
|
||||
shader_view_format::all_tests(&mut tests);
|
||||
shader::all_tests(&mut tests);
|
||||
subgroup_operations::all_tests(&mut tests);
|
||||
texture_binding::all_tests(&mut tests);
|
||||
texture_blit::all_tests(&mut tests);
|
||||
texture_bounds::all_tests(&mut tests);
|
||||
texture_view_creation::all_tests(&mut tests);
|
||||
timestamp_normalization::all_tests(&mut tests);
|
||||
timestamp_query::all_tests(&mut tests);
|
||||
transfer::all_tests(&mut tests);
|
||||
transition_resources::all_tests(&mut tests);
|
||||
vertex_formats::all_tests(&mut tests);
|
||||
vertex_indices::all_tests(&mut tests);
|
||||
write_texture::all_tests(&mut tests);
|
||||
zero_init_texture_after_discard::all_tests(&mut tests);
|
||||
|
||||
tests
|
||||
}
|
||||
|
||||
wgpu_test::gpu_test_main!(all_tests());
|
||||
|
||||
@ -1,3 +1,17 @@
|
||||
#[allow(
|
||||
clippy::allow_attributes,
|
||||
reason = "Using expect is going to be much more verbose"
|
||||
)]
|
||||
#[allow(clippy::ptr_arg)]
|
||||
pub fn all_tests(_vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
#[cfg(any(
|
||||
not(target_arch = "wasm32"),
|
||||
target_os = "emscripten",
|
||||
feature = "webgl"
|
||||
))]
|
||||
_vec.push(SIMPLE_DRAW_CHECK_MEM_LEAKS);
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
not(target_arch = "wasm32"),
|
||||
target_os = "emscripten",
|
||||
|
||||
@ -1,7 +1,21 @@
|
||||
use std::{io::Write, process::Stdio};
|
||||
|
||||
use wgpu::util::DeviceExt;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
MESH_PIPELINE_BASIC_MESH,
|
||||
MESH_PIPELINE_BASIC_TASK_MESH,
|
||||
MESH_PIPELINE_BASIC_MESH_FRAG,
|
||||
MESH_PIPELINE_BASIC_TASK_MESH_FRAG,
|
||||
MESH_DRAW_INDIRECT,
|
||||
MESH_MULTI_DRAW_INDIRECT,
|
||||
MESH_MULTI_DRAW_INDIRECT_COUNT,
|
||||
]);
|
||||
}
|
||||
|
||||
// Same as in mesh shader example
|
||||
fn compile_glsl(
|
||||
|
||||
@ -1,6 +1,16 @@
|
||||
//! Tests for nv12 texture creation and sampling.
|
||||
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
NV12_TEXTURE_CREATION_SAMPLING,
|
||||
NV12_TEXTURE_VIEW_PLANE_ON_NON_PLANAR_FORMAT,
|
||||
NV12_TEXTURE_VIEW_PLANE_OUT_OF_BOUNDS,
|
||||
NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE,
|
||||
NV12_TEXTURE_BAD_SIZE,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static NV12_TEXTURE_CREATION_SAMPLING: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
use wgpu::InstanceFlags;
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(OCCLUSION_QUERY);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static OCCLUSION_QUERY: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
use wgpu::{Backend, Backends};
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
RESTRICT_WORKGROUP_PRIVATE_FUNCTION_LET,
|
||||
D3D12_RESTRICT_DYNAMIC_BUFFERS,
|
||||
]);
|
||||
}
|
||||
|
||||
/// Tests that writing and reading to the max length of a container (vec, mat, array)
|
||||
/// in the workgroup, private and function address spaces + let declarations
|
||||
/// will instead write to and read from the last element.
|
||||
|
||||
@ -5,8 +5,20 @@ use wgpu::{
|
||||
CreateTlasDescriptor, Error, ErrorFilter, Extent3d, Features, QuerySetDescriptor, QueryType,
|
||||
TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, VertexFormat,
|
||||
};
|
||||
use wgpu_test::GpuTestInitializer;
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
TEXTURE_OOM_TEST,
|
||||
BUFFER_OOM_TEST,
|
||||
MAPPING_BUFFER_OOM_TEST,
|
||||
QUERY_SET_OOM_TEST,
|
||||
BLAS_OOM_TEST,
|
||||
TLAS_OOM_TEST,
|
||||
]);
|
||||
}
|
||||
|
||||
// Tests in this file must all end with "OOM_TEST" so that nextest doesn't run any other tests while it runs one of the OOM tests.
|
||||
// This is done so that other tests that create resources will not fail with OOM errors due to the OOM tests running in parallel.
|
||||
|
||||
|
||||
@ -1,4 +1,14 @@
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE,
|
||||
COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX,
|
||||
RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE,
|
||||
RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX,
|
||||
NO_TARGETLESS_RENDER,
|
||||
]);
|
||||
}
|
||||
|
||||
const INVALID_SHADER_DESC: wgpu::ShaderModuleDescriptor = wgpu::ShaderModuleDescriptor {
|
||||
label: Some("invalid shader"),
|
||||
|
||||
@ -2,6 +2,10 @@ use std::{fmt::Write, num::NonZeroU64};
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
vec.push(PIPELINE_CACHE);
|
||||
}
|
||||
|
||||
/// We want to test that using a pipeline cache doesn't cause failure
|
||||
///
|
||||
/// It would be nice if we could also assert that reusing a pipeline cache would make compilation
|
||||
|
||||
@ -6,7 +6,18 @@ use wgpu::{
|
||||
CommandEncoderDescriptor, ComputePassDescriptor, PollType, ShaderStages,
|
||||
};
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestingContext};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
WAIT,
|
||||
DOUBLE_WAIT,
|
||||
WAIT_ON_SUBMISSION,
|
||||
DOUBLE_WAIT_ON_SUBMISSION,
|
||||
WAIT_OUT_OF_ORDER,
|
||||
WAIT_AFTER_BAD_SUBMISSION,
|
||||
]);
|
||||
}
|
||||
|
||||
fn generate_dummy_work(ctx: &TestingContext) -> CommandBuffer {
|
||||
let buffer = ctx.device.create_buffer(&BufferDescriptor {
|
||||
|
||||
@ -3,7 +3,13 @@ use std::num::NonZeroU64;
|
||||
|
||||
use wgpu::util::RenderEncoder;
|
||||
use wgpu::*;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([PARTIAL_UPDATE, RENDER_PASS_TEST]);
|
||||
}
|
||||
|
||||
/// We want to test that partial updates to push constants work as expected.
|
||||
///
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(DROP_FAILED_TIMESTAMP_QUERY_SET);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static DROP_FAILED_TIMESTAMP_QUERY_SET: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,7 +1,15 @@
|
||||
//! Tests for buffer copy validation.
|
||||
|
||||
use wgpu::PollType;
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
QUEUE_WRITE_TEXTURE_THEN_DESTROY,
|
||||
QUEUE_WRITE_TEXTURE_OVERFLOW,
|
||||
QUEUE_WRITE_TEXTURE_BUFFER_OOB,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static QUEUE_WRITE_TEXTURE_THEN_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -3,7 +3,29 @@ use std::iter;
|
||||
use crate::ray_tracing::{acceleration_structure_limits, AsBuildContext};
|
||||
use wgpu::util::{BufferInitDescriptor, DeviceExt};
|
||||
use wgpu::*;
|
||||
use wgpu_test::{fail, fail_if, gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
fail, fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters,
|
||||
TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
UNBUILT_BLAS,
|
||||
UNBUILT_BLAS_COMPACTION,
|
||||
BLAS_COMPACTION_WITHOUT_FLAGS,
|
||||
UNPREPARED_BLAS_COMPACTION,
|
||||
BLAS_COMPACTION,
|
||||
OUT_OF_ORDER_AS_BUILD,
|
||||
OUT_OF_ORDER_AS_BUILD_USE,
|
||||
EMPTY_BUILD,
|
||||
BUILD_WITH_TRANSFORM,
|
||||
ONLY_BLAS_VERTEX_RETURN,
|
||||
ONLY_TLAS_VERTEX_RETURN,
|
||||
EXTRA_FORMAT_BUILD,
|
||||
MISALIGNED_BUILD,
|
||||
TOO_SMALL_STRIDE_BUILD,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static UNBUILT_BLAS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -8,6 +8,10 @@ use wgpu::{IndexFormat, VertexFormat};
|
||||
use wgpu_macros::gpu_test;
|
||||
use wgpu_test::{fail, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
tests.extend([BLAS_INVALID_VERTEX_FORMAT, BLAS_MISMATCHED_INDEX]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BLAS_INVALID_VERTEX_FORMAT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -13,6 +13,10 @@ use wgpu::{
|
||||
use wgpu_macros::gpu_test;
|
||||
use wgpu_test::{GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
tests.push(ACCELERATION_STRUCTURE_USE_AFTER_FREE);
|
||||
}
|
||||
|
||||
fn required_features() -> wgpu::Features {
|
||||
wgpu::Features::EXPERIMENTAL_RAY_QUERY
|
||||
}
|
||||
|
||||
@ -10,6 +10,10 @@ use wgpu::{
|
||||
use wgpu_macros::gpu_test;
|
||||
use wgpu_test::{fail, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
tests.push(LIMITS_HIT);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static LIMITS_HIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -18,6 +18,15 @@ mod limits;
|
||||
mod scene;
|
||||
mod shader;
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
as_build::all_tests(tests);
|
||||
as_create::all_tests(tests);
|
||||
as_use_after_free::all_tests(tests);
|
||||
limits::all_tests(tests);
|
||||
scene::all_tests(tests);
|
||||
shader::all_tests(tests);
|
||||
}
|
||||
|
||||
fn acceleration_structure_limits() -> wgpu::Limits {
|
||||
wgpu::Limits::default().using_minimum_supported_acceleration_structure_values()
|
||||
}
|
||||
|
||||
@ -9,6 +9,13 @@ use glam::{Affine3A, Quat, Vec3};
|
||||
|
||||
mod mesh_gen;
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
tests.extend([
|
||||
ACCELERATION_STRUCTURE_BUILD_NO_INDEX,
|
||||
ACCELERATION_STRUCTURE_BUILD_WITH_INDEX,
|
||||
]);
|
||||
}
|
||||
|
||||
fn acceleration_structure_build(ctx: &TestingContext, use_index_buffer: bool) {
|
||||
let max_instances = 1000;
|
||||
let device = &ctx.device;
|
||||
|
||||
@ -5,10 +5,15 @@ use wgpu::{
|
||||
};
|
||||
use wgpu::{AccelerationStructureFlags, BufferUsages};
|
||||
use wgpu_macros::gpu_test;
|
||||
use wgpu_test::GpuTestInitializer;
|
||||
use wgpu_test::{GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
const STRUCT_SIZE: wgpu::BufferAddress = 176;
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.push(ACCESS_ALL_STRUCT_MEMBERS);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static ACCESS_ALL_STRUCT_MEMBERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
use wgpu::util::DeviceExt;
|
||||
use wgpu_test::{
|
||||
gpu_test, image::ReadbackBuffers, GpuTestConfiguration, TestParameters, TestingContext,
|
||||
gpu_test, image::ReadbackBuffers, GpuTestConfiguration, GpuTestInitializer, TestParameters,
|
||||
TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(MULTI_STAGE_DATA_BINDING);
|
||||
}
|
||||
|
||||
/// We thought we had an OpenGL bug that, when running without explicit in-shader locations,
|
||||
/// we will not properly bind uniform buffers to both the vertex and fragment
|
||||
/// shaders. This turned out to not reproduce at all with this test case.
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
use wgpu::*;
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(PASS_RESET_VERTEX_BUFFER);
|
||||
}
|
||||
|
||||
/// The core issue here was that we weren't properly disabling vertex attributes on GL
|
||||
/// when a renderpass ends. This ended up being rather tricky to test for as GL is remarkably
|
||||
/// tolerant of errors. This test, with the fix not-applied, only fails on WebGL.
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::Mutex;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
use wgpu::*;
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(QUEUE_SUBMITTED_CALLBACK_ORDERING);
|
||||
}
|
||||
|
||||
/// The WebGPU specification has very specific requirements about the ordering of map_async
|
||||
/// and on_submitted_work_done callbacks. Specifically, all map_async callbacks that are initiated
|
||||
/// before a given on_submitted_work_done callback must be invoked before the on_submitted_work_done
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
use std::ops::Range;
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(CLEAR_BUFFER_RANGE_RESPECTED);
|
||||
}
|
||||
|
||||
async fn fill_test(ctx: &TestingContext, range: Range<u64>, size: u64) -> bool {
|
||||
let gpu_buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
use wgpu_test::{gpu_test, image, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, image, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(CONTINUE_SWITCH);
|
||||
}
|
||||
|
||||
/// FXC doesn't accept `continue` inside a switch. Instead we store a flag for whether
|
||||
/// the loop should continue that is checked after the switch.
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
use wgpu_test::{gpu_test, image, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, image, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(DEGENERATE_SWITCH);
|
||||
}
|
||||
|
||||
/// FXC and potentially some glsl consumers have a bug when handling switch statements on a constant
|
||||
/// with just a default case. (not sure if the constant part is relevant)
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
use wgpu::*;
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(ALLOW_INPUT_NOT_CONSUMED);
|
||||
}
|
||||
|
||||
/// Previously, for every user-defined vertex output a fragment shader had to have a corresponding
|
||||
/// user-defined input. This would generate `StageError::InputNotConsumed`.
|
||||
///
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
use wgpu::{DownlevelFlags, Limits};
|
||||
use wgpu_macros::gpu_test;
|
||||
use wgpu_test::{fail, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{fail, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(NON_FATAL_ERRORS_IN_QUEUE_SUBMIT);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static NON_FATAL_ERRORS_IN_QUEUE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
use wgpu::util::DeviceExt;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(ZERO_WORKGROUP_COUNT);
|
||||
}
|
||||
|
||||
/// Running a compute shader with a total workgroup count of zero implies that no work
|
||||
/// should be done, and is a user error. Vulkan and DX12 accept this invalid input with grace, but
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
tests.extend([TEST_SINGLE_WRITE, TEST_SCATTER]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static TEST_SINGLE_WRITE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -12,7 +12,18 @@
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use wgpu::util::DeviceExt as _;
|
||||
use wgpu_test::{gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, valid, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
RENDER_PASS_RESOURCE_OWNERSHIP,
|
||||
RENDER_PASS_QUERY_SET_OWNERSHIP_PIPELINE_STATISTICS,
|
||||
RENDER_PASS_QUERY_SET_OWNERSHIP_TIMESTAMPS,
|
||||
RENDER_PASS_KEEP_ENCODER_ALIVE,
|
||||
]);
|
||||
}
|
||||
|
||||
// Minimal shader with buffer based side effect - only needed to check whether the render pass has executed at all.
|
||||
const SHADER_SRC: &str = "
|
||||
|
||||
@ -2,7 +2,19 @@ use wgpu::{
|
||||
util::{BufferInitDescriptor, DeviceExt},
|
||||
vertex_attr_array,
|
||||
};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
DRAW_TO_2D_VIEW,
|
||||
DRAW_TO_2D_ARRAY_VIEW,
|
||||
RESOLVE_TO_2D_VIEW,
|
||||
RESOLVE_TO_2D_ARRAY_VIEW,
|
||||
DRAW_TO_3D_VIEW,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static DRAW_TO_2D_VIEW: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(BUFFER_SIZE_AND_USAGE);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BUFFER_SIZE_AND_USAGE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
use wgpu_test::{fail, gpu_test, valid, GpuTestConfiguration};
|
||||
use wgpu_test::{fail, gpu_test, valid, GpuTestConfiguration, GpuTestInitializer};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([BAD_BUFFER, BAD_TEXTURE]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static BAD_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
||||
|
||||
@ -2,7 +2,19 @@
|
||||
//!
|
||||
//! Do some tests to ensure things are working correctly and nothing gets mad.
|
||||
|
||||
use wgpu_test::{did_oom, gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{
|
||||
did_oom, gpu_test, valid, GpuTestConfiguration, GpuTestInitializer, TestParameters,
|
||||
TestingContext,
|
||||
};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
SAMPLER_DEDUPLICATION,
|
||||
SAMPLER_CREATION_FAILURE,
|
||||
SAMPLER_SINGLE_BIND_GROUP,
|
||||
SAMPLER_MULTI_BIND_GROUP,
|
||||
]);
|
||||
}
|
||||
|
||||
// A number large enough to likely cause sampler caches to run out of space
|
||||
// on some devices.
|
||||
|
||||
@ -1,4 +1,13 @@
|
||||
use wgpu_test::{gpu_test, image, GpuTestConfiguration, TestingContext};
|
||||
use wgpu_test::{gpu_test, image, GpuTestConfiguration, GpuTestInitializer, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
SCISSOR_TEST_FULL_RECT,
|
||||
SCISSOR_TEST_EMPTY_RECT,
|
||||
SCISSOR_TEST_EMPTY_RECT_WITH_OFFSET,
|
||||
SCISSOR_TEST_CUSTOM_RECT,
|
||||
]);
|
||||
}
|
||||
|
||||
struct Rect {
|
||||
x: u32,
|
||||
|
||||
@ -3,6 +3,10 @@ use wgpu::util::DeviceExt;
|
||||
use wgpu::{BufferDescriptor, BufferUsages, MapMode, PollType};
|
||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
vec.push(ARRAY_SIZE_OVERRIDES);
|
||||
}
|
||||
|
||||
const SHADER: &str = r#"
|
||||
const testing_shared: array<i32, 1> = array(8);
|
||||
override n = testing_shared[0u];
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
use wgpu::include_wgsl;
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([SHADER_COMPILE_SUCCESS, SHADER_COMPILE_ERROR]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static SHADER_COMPILE_SUCCESS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
use wgpu::{DownlevelFlags, Limits};
|
||||
|
||||
use crate::shader::{shader_input_output_test, InputStorageType, ShaderTest};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([UNPACK4xU8, UNPACK4xI8, PACK4xU8, PACK4xI8]);
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
fn create_unpack4xU8_test() -> Vec<ShaderTest> {
|
||||
|
||||
@ -13,7 +13,7 @@ use wgpu::{
|
||||
ShaderModuleDescriptor, ShaderSource, ShaderStages,
|
||||
};
|
||||
|
||||
use wgpu_test::TestingContext;
|
||||
use wgpu_test::{GpuTestInitializer, TestingContext};
|
||||
|
||||
pub mod array_size_overrides;
|
||||
pub mod compilation_messages;
|
||||
@ -23,6 +23,16 @@ pub mod struct_layout;
|
||||
pub mod workgroup_size_overrides;
|
||||
pub mod zero_init_workgroup_mem;
|
||||
|
||||
pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
||||
array_size_overrides::all_tests(tests);
|
||||
compilation_messages::all_tests(tests);
|
||||
data_builtins::all_tests(tests);
|
||||
numeric_builtins::all_tests(tests);
|
||||
struct_layout::all_tests(tests);
|
||||
workgroup_size_overrides::all_tests(tests);
|
||||
zero_init_workgroup_mem::all_tests(tests);
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
enum InputStorageType {
|
||||
Uniform,
|
||||
|
||||
@ -1,7 +1,16 @@
|
||||
use wgpu::{DownlevelFlags, Limits};
|
||||
|
||||
use crate::shader::{shader_input_output_test, InputStorageType, ShaderTest};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
NUMERIC_BUILTINS,
|
||||
INT64_ATOMIC_MIN_MAX,
|
||||
INT64_ATOMIC_ALL_OPS,
|
||||
FLOAT32_ATOMIC,
|
||||
]);
|
||||
}
|
||||
|
||||
fn create_numeric_builtin_test() -> Vec<ShaderTest> {
|
||||
let mut tests = Vec::new();
|
||||
|
||||
@ -3,7 +3,20 @@ use std::fmt::Write;
|
||||
use wgpu::{Backends, DownlevelFlags, Features, Limits};
|
||||
|
||||
use crate::shader::{shader_input_output_test, InputStorageType, ShaderTest, MAX_BUFFER_SIZE};
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([
|
||||
UNIFORM_INPUT,
|
||||
STORAGE_INPUT,
|
||||
PUSH_CONSTANT_INPUT,
|
||||
UNIFORM_INPUT_INT64,
|
||||
STORAGE_INPUT_INT64,
|
||||
PUSH_CONSTANT_INPUT_INT64,
|
||||
UNIFORM_INPUT_F16,
|
||||
STORAGE_INPUT_F16,
|
||||
]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static UNIFORM_INPUT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -3,6 +3,10 @@ use wgpu::util::DeviceExt;
|
||||
use wgpu::{BufferDescriptor, BufferUsages, MapMode, PollType};
|
||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
vec.push(WORKGROUP_SIZE_OVERRIDES);
|
||||
}
|
||||
|
||||
const SHADER: &str = r#"
|
||||
override n = 3;
|
||||
|
||||
|
||||
@ -8,7 +8,11 @@ use wgpu::{
|
||||
ShaderStages,
|
||||
};
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(ZERO_INIT_WORKGROUP_MEMORY);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static ZERO_INIT_WORKGROUP_MEMORY: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
use wgpu::util::DeviceExt;
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
vec.extend([DRAW, DRAW_INDEXED]);
|
||||
}
|
||||
|
||||
//
|
||||
// These tests render two triangles to a 2x2 render target. The first triangle
|
||||
// in the vertex buffer covers the bottom-left pixel, the second triangle
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
use wgpu::{util::DeviceExt, DownlevelFlags, Limits, TextureFormat};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||
vec.push(REINTERPRET_SRGB);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static REINTERPRET_SRGB: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
.parameters(
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
|
||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.push(SUBGROUP_OPERATIONS);
|
||||
}
|
||||
|
||||
const THREAD_COUNT: u64 = 128;
|
||||
const TEST_COUNT: u32 = 37;
|
||||
|
||||
@ -7,7 +7,11 @@ use wgpu::{
|
||||
TextureDescriptor, TextureDimension, TextureFormat, TextureUsages,
|
||||
};
|
||||
use wgpu_macros::gpu_test;
|
||||
use wgpu_test::{GpuTestConfiguration, TestParameters, TestingContext};
|
||||
use wgpu_test::{GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext};
|
||||
|
||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||
vec.extend([TEXTURE_BINDING, SINGLE_SCALAR_LOAD]);
|
||||
}
|
||||
|
||||
#[gpu_test]
|
||||
static TEXTURE_BINDING: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user