mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Label no-op supporting tests
This commit is contained in:
parent
09d0c94576
commit
3e153fb8ec
@ -6,7 +6,7 @@ use std::{ffi::OsStr, fs, path::Path};
|
|||||||
/// Runs through all example shaders and ensures they are valid wgsl.
|
/// Runs through all example shaders and ensures they are valid wgsl.
|
||||||
// While we _can_ run this test under miri, it is extremely slow (>5 minutes),
|
// While we _can_ run this test under miri, it is extremely slow (>5 minutes),
|
||||||
// and naga isn't the primary target for miri testing, so we disable it.
|
// and naga isn't the primary target for miri testing, so we disable it.
|
||||||
#[cfg(not(miri))]
|
#[cfg_attr(miri, ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
pub fn parse_example_wgsl() {
|
pub fn parse_example_wgsl() {
|
||||||
let example_path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
let example_path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
|||||||
@ -820,7 +820,8 @@ fn write_output_wgsl(
|
|||||||
|
|
||||||
// While we _can_ run this test under miri, it is extremely slow (>5 minutes),
|
// While we _can_ run this test under miri, it is extremely slow (>5 minutes),
|
||||||
// and naga isn't the primary target for miri testing, so we disable it.
|
// and naga isn't the primary target for miri testing, so we disable it.
|
||||||
#[cfg(all(feature = "wgsl-in", not(miri)))]
|
#[cfg(feature = "wgsl-in")]
|
||||||
|
#[cfg_attr(miri, ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
fn convert_snapshots_wgsl() {
|
fn convert_snapshots_wgsl() {
|
||||||
let _ = env_logger::try_init();
|
let _ = env_logger::try_init();
|
||||||
@ -846,7 +847,8 @@ fn convert_snapshots_wgsl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// miri doesn't allow us to shell out to `spirv-as`
|
// miri doesn't allow us to shell out to `spirv-as`
|
||||||
#[cfg(all(feature = "spv-in", not(miri)))]
|
#[cfg(feature = "spv-in")]
|
||||||
|
#[cfg_attr(miri, ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
fn convert_snapshots_spv() {
|
fn convert_snapshots_spv() {
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
@ -897,7 +899,8 @@ fn convert_snapshots_spv() {
|
|||||||
|
|
||||||
// While we _can_ run this test under miri, it is extremely slow (>5 minutes),
|
// While we _can_ run this test under miri, it is extremely slow (>5 minutes),
|
||||||
// and naga isn't the primary target for miri testing, so we disable it.
|
// and naga isn't the primary target for miri testing, so we disable it.
|
||||||
#[cfg(all(feature = "glsl-in", not(miri)))]
|
#[cfg(feature = "glsl-in")]
|
||||||
|
#[cfg_attr(miri, ignore)]
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
#[test]
|
#[test]
|
||||||
fn convert_snapshots_glsl() {
|
fn convert_snapshots_glsl() {
|
||||||
|
|||||||
@ -245,7 +245,7 @@ impl Corpus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(miri))]
|
#[cfg_attr(miri, ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_api() {
|
fn test_api() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#![cfg(not(miri))]
|
#![cfg(not(miri))]
|
||||||
// Tests that ensure that various constructs that should not compile do not compile.
|
// Tests that ensure that various constructs that should not compile do not compile.
|
||||||
|
|
||||||
|
#[cfg_attr(miri, ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
fn compile_fail() {
|
fn compile_fail() {
|
||||||
let t = trybuild::TestCases::new();
|
let t = trybuild::TestCases::new();
|
||||||
|
|||||||
@ -40,7 +40,11 @@ const ENTRY: wgpu::BindGroupLayoutEntry = wgpu::BindGroupLayoutEntry {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_LAYOUT_DEDUPLICATION: GpuTestConfiguration = GpuTestConfiguration::new()
|
static BIND_GROUP_LAYOUT_DEDUPLICATION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(bgl_dedupe);
|
.run_async(bgl_dedupe);
|
||||||
|
|
||||||
async fn bgl_dedupe(ctx: TestingContext) {
|
async fn bgl_dedupe(ctx: TestingContext) {
|
||||||
@ -120,7 +124,11 @@ async fn bgl_dedupe(ctx: TestingContext) {
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_LAYOUT_DEDUPLICATION_WITH_DROPPED_USER_HANDLE: GpuTestConfiguration =
|
static BIND_GROUP_LAYOUT_DEDUPLICATION_WITH_DROPPED_USER_HANDLE: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(bgl_dedupe_with_dropped_user_handle);
|
.run_sync(bgl_dedupe_with_dropped_user_handle);
|
||||||
|
|
||||||
// https://github.com/gfx-rs/wgpu/issues/4824
|
// https://github.com/gfx-rs/wgpu/issues/4824
|
||||||
@ -203,7 +211,11 @@ fn bgl_dedupe_with_dropped_user_handle(ctx: TestingContext) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static GET_DERIVED_BGL: GpuTestConfiguration = GpuTestConfiguration::new()
|
static GET_DERIVED_BGL: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(get_derived_bgl);
|
.run_sync(get_derived_bgl);
|
||||||
|
|
||||||
fn get_derived_bgl(ctx: TestingContext) {
|
fn get_derived_bgl(ctx: TestingContext) {
|
||||||
@ -277,7 +289,11 @@ fn get_derived_bgl(ctx: TestingContext) {
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static SEPARATE_PIPELINES_HAVE_INCOMPATIBLE_DERIVED_BGLS: GpuTestConfiguration =
|
static SEPARATE_PIPELINES_HAVE_INCOMPATIBLE_DERIVED_BGLS: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(separate_pipelines_have_incompatible_derived_bgls);
|
.run_sync(separate_pipelines_have_incompatible_derived_bgls);
|
||||||
|
|
||||||
fn separate_pipelines_have_incompatible_derived_bgls(ctx: TestingContext) {
|
fn separate_pipelines_have_incompatible_derived_bgls(ctx: TestingContext) {
|
||||||
@ -341,7 +357,11 @@ fn separate_pipelines_have_incompatible_derived_bgls(ctx: TestingContext) {
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DERIVED_BGLS_INCOMPATIBLE_WITH_REGULAR_BGLS: GpuTestConfiguration =
|
static DERIVED_BGLS_INCOMPATIBLE_WITH_REGULAR_BGLS: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(derived_bgls_incompatible_with_regular_bgls);
|
.run_sync(derived_bgls_incompatible_with_regular_bgls);
|
||||||
|
|
||||||
fn derived_bgls_incompatible_with_regular_bgls(ctx: TestingContext) {
|
fn derived_bgls_incompatible_with_regular_bgls(ctx: TestingContext) {
|
||||||
@ -412,7 +432,11 @@ fn derived_bgls_incompatible_with_regular_bgls(ctx: TestingContext) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_LAYOUT_DEDUPLICATION_DERIVED: GpuTestConfiguration = GpuTestConfiguration::new()
|
static BIND_GROUP_LAYOUT_DEDUPLICATION_DERIVED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(bgl_dedupe_derived);
|
.run_sync(bgl_dedupe_derived);
|
||||||
|
|
||||||
fn bgl_dedupe_derived(ctx: TestingContext) {
|
fn bgl_dedupe_derived(ctx: TestingContext) {
|
||||||
|
|||||||
@ -176,14 +176,15 @@ static MULTIPLE_BINDINGS_WITH_DIFFERENT_SIZES: GpuTestConfiguration = GpuTestCon
|
|||||||
.parameters(
|
.parameters(
|
||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.limits(wgpu::Limits::downlevel_defaults())
|
.limits(wgpu::Limits::downlevel_defaults())
|
||||||
.expect_fail(FailureCase::always()), // https://github.com/gfx-rs/wgpu/issues/7359
|
.expect_fail(FailureCase::always())
|
||||||
|
.enable_noop(), // https://github.com/gfx-rs/wgpu/issues/7359
|
||||||
)
|
)
|
||||||
.run_sync(multiple_bindings_with_differing_sizes);
|
.run_sync(multiple_bindings_with_differing_sizes);
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_NONFILTERING_LAYOUT_NONFILTERING_SAMPLER: GpuTestConfiguration =
|
static BIND_GROUP_NONFILTERING_LAYOUT_NONFILTERING_SAMPLER: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
try_sampler_nonfiltering_layout(
|
try_sampler_nonfiltering_layout(
|
||||||
ctx,
|
ctx,
|
||||||
@ -201,7 +202,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_NONFILTERING_SAMPLER: GpuTestConfiguration
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_NONFILTERING_LAYOUT_MIN_SAMPLER: GpuTestConfiguration =
|
static BIND_GROUP_NONFILTERING_LAYOUT_MIN_SAMPLER: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
try_sampler_nonfiltering_layout(
|
try_sampler_nonfiltering_layout(
|
||||||
ctx,
|
ctx,
|
||||||
@ -219,7 +220,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_MIN_SAMPLER: GpuTestConfiguration =
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_NONFILTERING_LAYOUT_MAG_SAMPLER: GpuTestConfiguration =
|
static BIND_GROUP_NONFILTERING_LAYOUT_MAG_SAMPLER: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
try_sampler_nonfiltering_layout(
|
try_sampler_nonfiltering_layout(
|
||||||
ctx,
|
ctx,
|
||||||
@ -237,7 +238,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_MAG_SAMPLER: GpuTestConfiguration =
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BIND_GROUP_NONFILTERING_LAYOUT_MIPMAP_SAMPLER: GpuTestConfiguration =
|
static BIND_GROUP_NONFILTERING_LAYOUT_MIPMAP_SAMPLER: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
try_sampler_nonfiltering_layout(
|
try_sampler_nonfiltering_layout(
|
||||||
ctx,
|
ctx,
|
||||||
|
|||||||
@ -95,78 +95,84 @@ async fn test_empty_buffer_range(ctx: &TestingContext, buffer_size: u64, label:
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static EMPTY_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new()
|
static EMPTY_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().expect_fail(FailureCase::always()))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.expect_fail(FailureCase::always())
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
test_empty_buffer_range(&ctx, 2048, "regular buffer").await;
|
test_empty_buffer_range(&ctx, 2048, "regular buffer").await;
|
||||||
test_empty_buffer_range(&ctx, 0, "zero-sized buffer").await;
|
test_empty_buffer_range(&ctx, 0, "zero-sized buffer").await;
|
||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new().run_async(|ctx| async move {
|
static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
// This test writes 16 bytes at the beginning of buffer mapped mapped with
|
.parameters(TestParameters::default().enable_noop())
|
||||||
// an offset of 32 bytes. Then the buffer is copied into another buffer that
|
.run_async(|ctx| async move {
|
||||||
// is read back and we check that the written bytes are correctly placed at
|
// This test writes 16 bytes at the beginning of buffer mapped mapped with
|
||||||
// offset 32..48.
|
// an offset of 32 bytes. Then the buffer is copied into another buffer that
|
||||||
// The goal is to check that get_mapped_range did not accidentally double-count
|
// is read back and we check that the written bytes are correctly placed at
|
||||||
// the mapped offset.
|
// offset 32..48.
|
||||||
|
// The goal is to check that get_mapped_range did not accidentally double-count
|
||||||
|
// the mapped offset.
|
||||||
|
|
||||||
let write_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
let write_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
size: 256,
|
size: 256,
|
||||||
usage: wgpu::BufferUsages::MAP_WRITE | wgpu::BufferUsages::COPY_SRC,
|
usage: wgpu::BufferUsages::MAP_WRITE | wgpu::BufferUsages::COPY_SRC,
|
||||||
mapped_at_creation: false,
|
mapped_at_creation: false,
|
||||||
});
|
});
|
||||||
let read_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
let read_buf = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
size: 256,
|
size: 256,
|
||||||
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST,
|
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST,
|
||||||
mapped_at_creation: false,
|
mapped_at_creation: false,
|
||||||
});
|
|
||||||
|
|
||||||
write_buf
|
|
||||||
.slice(32..)
|
|
||||||
.map_async(wgpu::MapMode::Write, move |result| {
|
|
||||||
result.unwrap();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ctx.async_poll(wgpu::PollType::wait()).await.unwrap();
|
write_buf
|
||||||
|
.slice(32..)
|
||||||
|
.map_async(wgpu::MapMode::Write, move |result| {
|
||||||
|
result.unwrap();
|
||||||
|
});
|
||||||
|
|
||||||
{
|
ctx.async_poll(wgpu::PollType::wait()).await.unwrap();
|
||||||
let slice = write_buf.slice(32..48);
|
|
||||||
let mut view = slice.get_mapped_range_mut();
|
{
|
||||||
for byte in &mut view[..] {
|
let slice = write_buf.slice(32..48);
|
||||||
*byte = 2;
|
let mut view = slice.get_mapped_range_mut();
|
||||||
|
for byte in &mut view[..] {
|
||||||
|
*byte = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
write_buf.unmap();
|
write_buf.unmap();
|
||||||
|
|
||||||
let mut encoder = ctx
|
let mut encoder = ctx
|
||||||
.device
|
.device
|
||||||
.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
|
.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
|
||||||
|
|
||||||
encoder.copy_buffer_to_buffer(&write_buf, 0, &read_buf, 0, 256);
|
encoder.copy_buffer_to_buffer(&write_buf, 0, &read_buf, 0, 256);
|
||||||
|
|
||||||
ctx.queue.submit(Some(encoder.finish()));
|
ctx.queue.submit(Some(encoder.finish()));
|
||||||
|
|
||||||
read_buf
|
read_buf
|
||||||
.slice(..)
|
.slice(..)
|
||||||
.map_async(wgpu::MapMode::Read, Result::unwrap);
|
.map_async(wgpu::MapMode::Read, Result::unwrap);
|
||||||
|
|
||||||
ctx.async_poll(wgpu::PollType::wait()).await.unwrap();
|
ctx.async_poll(wgpu::PollType::wait()).await.unwrap();
|
||||||
|
|
||||||
let slice = read_buf.slice(..);
|
let slice = read_buf.slice(..);
|
||||||
let view = slice.get_mapped_range();
|
let view = slice.get_mapped_range();
|
||||||
for byte in &view[0..32] {
|
for byte in &view[0..32] {
|
||||||
assert_eq!(*byte, 0);
|
assert_eq!(*byte, 0);
|
||||||
}
|
}
|
||||||
for byte in &view[32..48] {
|
for byte in &view[32..48] {
|
||||||
assert_eq!(*byte, 2);
|
assert_eq!(*byte, 2);
|
||||||
}
|
}
|
||||||
for byte in &view[48..] {
|
for byte in &view[48..] {
|
||||||
assert_eq!(*byte, 0);
|
assert_eq!(*byte, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/// The WebGPU algorithm [validating shader binding][vsb] requires
|
/// The WebGPU algorithm [validating shader binding][vsb] requires
|
||||||
/// implementations to check that buffer bindings are large enough to
|
/// implementations to check that buffer bindings are large enough to
|
||||||
@ -177,7 +183,7 @@ static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new().run_async(
|
|||||||
/// 16 for that variable's group/index. Pipeline creation should fail.
|
/// 16 for that variable's group/index. Pipeline creation should fail.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT: GpuTestConfiguration = GpuTestConfiguration::new()
|
static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(TestParameters::default().test_features_limits().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// Create a shader module that statically uses a storage buffer.
|
// Create a shader module that statically uses a storage buffer.
|
||||||
let shader_module = ctx
|
let shader_module = ctx
|
||||||
@ -247,7 +253,7 @@ static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT: GpuTestConfiguration = GpuTestConfigu
|
|||||||
/// binding. Command recording should fail.
|
/// binding. Command recording should fail.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH: GpuTestConfiguration = GpuTestConfiguration::new()
|
static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(TestParameters::default().test_features_limits().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// This test tries to use a bindgroup layout with a
|
// This test tries to use a bindgroup layout with a
|
||||||
// min_binding_size of 16 to an index whose WGSL type requires 32
|
// min_binding_size of 16 to an index whose WGSL type requires 32
|
||||||
@ -344,7 +350,7 @@ static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH: GpuTestConfiguration = GpuTestConfi
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new()
|
static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = 16;
|
let size = 16;
|
||||||
|
|
||||||
@ -370,7 +376,7 @@ static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfi
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static CLEAR_OFFSET_PLUS_SIZE_OUTSIDE_U64_BOUNDS: GpuTestConfiguration =
|
static CLEAR_OFFSET_PLUS_SIZE_OUTSIDE_U64_BOUNDS: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use wgpu::BufferAddress;
|
use wgpu::BufferAddress;
|
||||||
|
|
||||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.push(COPY_ALIGNMENT);
|
vec.push(COPY_ALIGNMENT);
|
||||||
@ -26,49 +26,51 @@ fn try_copy(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static COPY_ALIGNMENT: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static COPY_ALIGNMENT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
try_copy(&ctx, 0, 0, None);
|
.parameters(TestParameters::default().enable_noop())
|
||||||
try_copy(
|
.run_sync(|ctx| {
|
||||||
&ctx,
|
try_copy(&ctx, 0, 0, None);
|
||||||
4,
|
try_copy(
|
||||||
16 + 1,
|
&ctx,
|
||||||
Some("copy size 17 does not respect `copy_buffer_alignment`"),
|
4,
|
||||||
);
|
16 + 1,
|
||||||
try_copy(
|
Some("copy size 17 does not respect `copy_buffer_alignment`"),
|
||||||
&ctx,
|
);
|
||||||
64,
|
try_copy(
|
||||||
20 + 2,
|
&ctx,
|
||||||
Some("copy size 22 does not respect `copy_buffer_alignment`"),
|
64,
|
||||||
);
|
20 + 2,
|
||||||
try_copy(
|
Some("copy size 22 does not respect `copy_buffer_alignment`"),
|
||||||
&ctx,
|
);
|
||||||
256,
|
try_copy(
|
||||||
44 + 3,
|
&ctx,
|
||||||
Some("copy size 47 does not respect `copy_buffer_alignment`"),
|
256,
|
||||||
);
|
44 + 3,
|
||||||
try_copy(&ctx, 1024, 8 + 4, None);
|
Some("copy size 47 does not respect `copy_buffer_alignment`"),
|
||||||
|
);
|
||||||
|
try_copy(&ctx, 1024, 8 + 4, None);
|
||||||
|
|
||||||
try_copy(&ctx, 0, 4, None);
|
try_copy(&ctx, 0, 4, None);
|
||||||
try_copy(
|
try_copy(
|
||||||
&ctx,
|
&ctx,
|
||||||
4 + 1,
|
4 + 1,
|
||||||
8,
|
8,
|
||||||
Some("buffer offset 5 is not aligned to block size or `copy_buffer_alignment`"),
|
Some("buffer offset 5 is not aligned to block size or `copy_buffer_alignment`"),
|
||||||
);
|
);
|
||||||
try_copy(
|
try_copy(
|
||||||
&ctx,
|
&ctx,
|
||||||
64 + 2,
|
64 + 2,
|
||||||
12,
|
12,
|
||||||
Some("buffer offset 66 is not aligned to block size or `copy_buffer_alignment`"),
|
Some("buffer offset 66 is not aligned to block size or `copy_buffer_alignment`"),
|
||||||
);
|
);
|
||||||
try_copy(
|
try_copy(
|
||||||
&ctx,
|
&ctx,
|
||||||
256 + 3,
|
256 + 3,
|
||||||
16,
|
16,
|
||||||
Some("buffer offset 259 is not aligned to block size or `copy_buffer_alignment`"),
|
Some("buffer offset 259 is not aligned to block size or `copy_buffer_alignment`"),
|
||||||
);
|
);
|
||||||
try_copy(&ctx, 1024 + 4, 4, None);
|
try_copy(&ctx, 1024 + 4, 4, None);
|
||||||
});
|
});
|
||||||
|
|
||||||
const BUFFER_SIZE: BufferAddress = 1234;
|
const BUFFER_SIZE: BufferAddress = 1234;
|
||||||
|
|
||||||
|
|||||||
@ -59,20 +59,26 @@ fn try_create(ctx: TestingContext, usages: &[(bool, &[wgpu::BufferUsages])]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BUFFER_USAGE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static BUFFER_USAGE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
try_create(
|
.parameters(TestParameters::default().enable_noop())
|
||||||
ctx,
|
.run_sync(|ctx| {
|
||||||
&[
|
try_create(
|
||||||
(false, ALWAYS_VALID),
|
ctx,
|
||||||
(true, NEEDS_MAPPABLE_PRIMARY_BUFFERS),
|
&[
|
||||||
(true, ALWAYS_FAIL),
|
(false, ALWAYS_VALID),
|
||||||
],
|
(true, NEEDS_MAPPABLE_PRIMARY_BUFFERS),
|
||||||
);
|
(true, ALWAYS_FAIL),
|
||||||
});
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BUFFER_USAGE_MAPPABLE_PRIMARY_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
static BUFFER_USAGE_MAPPABLE_PRIMARY_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
try_create(
|
try_create(
|
||||||
ctx,
|
ctx,
|
||||||
@ -169,7 +175,11 @@ async fn map_test(
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BUFFER_MAP_ASYNC_MAP_STATE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static BUFFER_MAP_ASYNC_MAP_STATE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::MAPPABLE_PRIMARY_BUFFERS)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(move |ctx| async move {
|
.run_async(move |ctx| async move {
|
||||||
for usage_type in ["invalid", "read", "write"] {
|
for usage_type in ["invalid", "read", "write"] {
|
||||||
for map_mode_type in [Ma::Read, Ma::Write] {
|
for map_mode_type in [Ma::Read, Ma::Write] {
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestInitializer, TestingContext};
|
use wgpu_test::{gpu_test, GpuTestInitializer, TestParameters, TestingContext};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.push(CLONEABLE_BUFFERS);
|
vec.push(CLONEABLE_BUFFERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static CLONEABLE_BUFFERS: GpuTestConfiguration =
|
static CLONEABLE_BUFFERS: GpuTestConfiguration = wgpu_test::GpuTestConfiguration::new()
|
||||||
wgpu_test::GpuTestConfiguration::new().run_sync(cloneable_buffers);
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_sync(cloneable_buffers);
|
||||||
|
|
||||||
// Test a basic case of cloneable types where you clone the buffer to be able
|
// Test a basic case of cloneable types where you clone the buffer to be able
|
||||||
// to access the buffer inside the callback as well as outside.
|
// to access the buffer inside the callback as well as outside.
|
||||||
|
|||||||
@ -175,7 +175,11 @@ async fn compute_pass_query_set_ownership_timestamps(ctx: TestingContext) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static COMPUTE_PASS_KEEP_ENCODER_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static COMPUTE_PASS_KEEP_ENCODER_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(compute_pass_keep_encoder_alive);
|
.run_async(compute_pass_keep_encoder_alive);
|
||||||
|
|
||||||
async fn compute_pass_keep_encoder_alive(ctx: TestingContext) {
|
async fn compute_pass_keep_encoder_alive(ctx: TestingContext) {
|
||||||
|
|||||||
@ -26,7 +26,11 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static CROSS_DEVICE_BIND_GROUP_USAGE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static CROSS_DEVICE_BIND_GROUP_USAGE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().expect_fail(FailureCase::always()))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.expect_fail(FailureCase::always())
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
// Create a bind group using a layout from another device. This should be a validation
|
// Create a bind group using a layout from another device. This should be a validation
|
||||||
// error but currently crashes.
|
// error but currently crashes.
|
||||||
@ -53,7 +57,7 @@ static CROSS_DEVICE_BIND_GROUP_USAGE: GpuTestConfiguration = GpuTestConfiguratio
|
|||||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
|
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEVICE_LIFETIME_CHECK: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DEVICE_LIFETIME_CHECK: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
ctx.instance.poll_all(false);
|
ctx.instance.poll_all(false);
|
||||||
|
|
||||||
@ -80,7 +84,7 @@ static DEVICE_LIFETIME_CHECK: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
|
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static MULTIPLE_DEVICES: GpuTestConfiguration = GpuTestConfiguration::new()
|
static MULTIPLE_DEVICES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
use pollster::FutureExt as _;
|
use pollster::FutureExt as _;
|
||||||
ctx.adapter
|
ctx.adapter
|
||||||
@ -162,7 +166,11 @@ async fn request_device_error_message() {
|
|||||||
// should turn into no-ops, per spec.
|
// should turn into no-ops, per spec.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEVICE_DESTROY_THEN_MORE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DEVICE_DESTROY_THEN_MORE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::CLEAR_TEXTURE))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::CLEAR_TEXTURE)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// Create some resources on the device that we will attempt to use *after* losing
|
// Create some resources on the device that we will attempt to use *after* losing
|
||||||
// the device.
|
// the device.
|
||||||
@ -474,7 +482,7 @@ static DEVICE_DESTROY_THEN_MORE: GpuTestConfiguration = GpuTestConfiguration::ne
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEVICE_DESTROY_THEN_LOST: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DEVICE_DESTROY_THEN_LOST: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
// This test checks that when device.destroy is called, the provided
|
// This test checks that when device.destroy is called, the provided
|
||||||
// DeviceLostClosure is called with reason DeviceLostReason::Destroyed.
|
// DeviceLostClosure is called with reason DeviceLostReason::Destroyed.
|
||||||
@ -509,7 +517,7 @@ static DEVICE_DESTROY_THEN_LOST: GpuTestConfiguration = GpuTestConfiguration::ne
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DIFFERENT_BGL_ORDER_BW_SHADER_AND_API: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DIFFERENT_BGL_ORDER_BW_SHADER_AND_API: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// This test addresses a bug found in multiple backends where `wgpu_core` and `wgpu_hal`
|
// This test addresses a bug found in multiple backends where `wgpu_core` and `wgpu_hal`
|
||||||
// backends made different assumptions about the element order of vectors of bind group
|
// backends made different assumptions about the element order of vectors of bind group
|
||||||
@ -636,7 +644,7 @@ static DIFFERENT_BGL_ORDER_BW_SHADER_AND_API: GpuTestConfiguration = GpuTestConf
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEVICE_DESTROY_THEN_BUFFER_CLEANUP: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DEVICE_DESTROY_THEN_BUFFER_CLEANUP: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// When a device is destroyed, its resources should be released,
|
// When a device is destroyed, its resources should be released,
|
||||||
// without causing a deadlock.
|
// without causing a deadlock.
|
||||||
@ -675,7 +683,7 @@ static DEVICE_DESTROY_THEN_BUFFER_CLEANUP: GpuTestConfiguration = GpuTestConfigu
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEVICE_AND_QUEUE_HAVE_DIFFERENT_IDS: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DEVICE_AND_QUEUE_HAVE_DIFFERENT_IDS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
let TestingContext {
|
let TestingContext {
|
||||||
adapter,
|
adapter,
|
||||||
|
|||||||
@ -74,7 +74,7 @@ static RESET_BIND_GROUPS: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
.limits(wgpu::Limits {
|
.limits(wgpu::Limits {
|
||||||
max_push_constant_size: 4,
|
max_push_constant_size: 4,
|
||||||
..wgpu::Limits::downlevel_defaults()
|
..wgpu::Limits::downlevel_defaults()
|
||||||
}),
|
}).enable_noop(),
|
||||||
)
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
@ -116,7 +116,8 @@ static ZERO_SIZED_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
.limits(wgpu::Limits {
|
.limits(wgpu::Limits {
|
||||||
max_push_constant_size: 4,
|
max_push_constant_size: 4,
|
||||||
..wgpu::Limits::downlevel_defaults()
|
..wgpu::Limits::downlevel_defaults()
|
||||||
}),
|
})
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
|
|||||||
@ -343,12 +343,18 @@ macro_rules! make_test {
|
|||||||
($name:ident, $test_data:expr, $expect_noop:expr, $features:expr) => {
|
($name:ident, $test_data:expr, $expect_noop:expr, $features:expr) => {
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static $name: GpuTestConfiguration = GpuTestConfiguration::new()
|
static $name: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(
|
.parameters({
|
||||||
TestParameters::default()
|
let params = TestParameters::default()
|
||||||
.downlevel_flags(wgpu::DownlevelFlags::INDIRECT_EXECUTION)
|
.downlevel_flags(wgpu::DownlevelFlags::INDIRECT_EXECUTION)
|
||||||
.features($features)
|
.features($features)
|
||||||
.limits(wgpu::Limits::downlevel_defaults()),
|
.limits(wgpu::Limits::downlevel_defaults());
|
||||||
)
|
|
||||||
|
if $expect_noop {
|
||||||
|
params.enable_noop()
|
||||||
|
} else {
|
||||||
|
params
|
||||||
|
}
|
||||||
|
})
|
||||||
.run_async(|ctx| run_test(ctx, $test_data, $expect_noop));
|
.run_async(|ctx| run_test(ctx, $test_data, $expect_noop));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ fn blend_state_with_dual_source_blending() -> BlendState {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DUAL_SOURCE_BLENDING_FEATURE_DISABLED: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DUAL_SOURCE_BLENDING_FEATURE_DISABLED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(dual_source_blending_disabled);
|
.run_async(dual_source_blending_disabled);
|
||||||
|
|
||||||
async fn dual_source_blending_disabled(ctx: TestingContext) {
|
async fn dual_source_blending_disabled(ctx: TestingContext) {
|
||||||
@ -118,7 +118,11 @@ async fn dual_source_blending_disabled(ctx: TestingContext) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DUAL_SOURCE_BLENDING_FEATURE_ENABLED: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DUAL_SOURCE_BLENDING_FEATURE_ENABLED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::DUAL_SOURCE_BLENDING))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::DUAL_SOURCE_BLENDING)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(dual_source_blending_enabled);
|
.run_async(dual_source_blending_enabled);
|
||||||
|
|
||||||
async fn dual_source_blending_enabled(ctx: TestingContext) {
|
async fn dual_source_blending_enabled(ctx: TestingContext) {
|
||||||
|
|||||||
@ -15,17 +15,23 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DROP_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static DROP_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let encoder = ctx
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.device
|
.run_sync(|ctx| {
|
||||||
.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
|
let encoder = ctx
|
||||||
drop(encoder);
|
.device
|
||||||
});
|
.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
|
||||||
|
drop(encoder);
|
||||||
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration =
|
static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().expect_fail(FailureCase::always()))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.expect_fail(FailureCase::always())
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// Use the device after the queue is dropped. Currently this panics
|
// Use the device after the queue is dropped. Currently this panics
|
||||||
// but it probably shouldn't.
|
// but it probably shouldn't.
|
||||||
@ -38,7 +44,7 @@ static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration =
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DROP_ENCODER_AFTER_ERROR: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DROP_ENCODER_AFTER_ERROR: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let mut encoder = ctx
|
let mut encoder = ctx
|
||||||
.device
|
.device
|
||||||
@ -82,11 +88,15 @@ static DROP_ENCODER_AFTER_ERROR: GpuTestConfiguration = GpuTestConfiguration::ne
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static ENCODER_OPERATIONS_FAIL_WHILE_PASS_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static ENCODER_OPERATIONS_FAIL_WHILE_PASS_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(
|
.parameters(
|
||||||
wgpu::Features::CLEAR_TEXTURE
|
TestParameters::default()
|
||||||
| wgpu::Features::TIMESTAMP_QUERY
|
.features(
|
||||||
| wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS,
|
wgpu::Features::CLEAR_TEXTURE
|
||||||
))
|
| wgpu::Features::TIMESTAMP_QUERY
|
||||||
|
| wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS,
|
||||||
|
)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(encoder_operations_fail_while_pass_alive);
|
.run_sync(encoder_operations_fail_while_pass_alive);
|
||||||
|
|
||||||
fn encoder_operations_fail_while_pass_alive(ctx: TestingContext) {
|
fn encoder_operations_fail_while_pass_alive(ctx: TestingContext) {
|
||||||
|
|||||||
@ -53,7 +53,7 @@ fn create_texture_binding(device: &wgpu::Device, format: wgpu::TextureFormat, fi
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static FLOAT32_FILTERABLE_WITHOUT_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static FLOAT32_FILTERABLE_WITHOUT_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let device = &ctx.device;
|
let device = &ctx.device;
|
||||||
// Unorm textures are always filterable
|
// Unorm textures are always filterable
|
||||||
@ -80,7 +80,11 @@ static FLOAT32_FILTERABLE_WITHOUT_FEATURE: GpuTestConfiguration = GpuTestConfigu
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static FLOAT32_FILTERABLE_WITH_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static FLOAT32_FILTERABLE_WITH_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::FLOAT32_FILTERABLE))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::FLOAT32_FILTERABLE)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let device = &ctx.device;
|
let device = &ctx.device;
|
||||||
// With the feature enabled, it does work!
|
// With the feature enabled, it does work!
|
||||||
|
|||||||
@ -172,7 +172,7 @@ async fn test_format(
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static IMAGE_ATOMICS_NOT_ENABLED: GpuTestConfiguration = GpuTestConfiguration::new()
|
static IMAGE_ATOMICS_NOT_ENABLED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
@ -200,7 +200,7 @@ static IMAGE_ATOMICS_NOT_ENABLED: GpuTestConfiguration = GpuTestConfiguration::n
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static IMAGE_ATOMICS_NOT_SUPPORTED: GpuTestConfiguration = GpuTestConfiguration::new()
|
static IMAGE_ATOMICS_NOT_SUPPORTED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_ATOMIC))
|
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_ATOMIC).enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.push(INITIALIZE);
|
vec.push(INITIALIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static INITIALIZE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|_ctx| {});
|
static INITIALIZE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_sync(|_ctx| {});
|
||||||
|
|||||||
@ -13,8 +13,9 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BUFFER_DESTROY: GpuTestConfiguration =
|
static BUFFER_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
label: Some("buffer"),
|
label: Some("buffer"),
|
||||||
size: 256,
|
size: 256,
|
||||||
@ -80,8 +81,9 @@ static BUFFER_DESTROY: GpuTestConfiguration =
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static TEXTURE_DESTROY: GpuTestConfiguration =
|
static TEXTURE_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
size: wgpu::Extent3d {
|
size: wgpu::Extent3d {
|
||||||
@ -118,7 +120,9 @@ static TEXTURE_DESTROY: GpuTestConfiguration =
|
|||||||
static BUFFER_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
static BUFFER_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(
|
.parameters(
|
||||||
// https://github.com/gfx-rs/wgpu/issues/7854
|
// https://github.com/gfx-rs/wgpu/issues/7854
|
||||||
TestParameters::default().skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe")),
|
TestParameters::default()
|
||||||
|
.skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe"))
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let buffer_source = ctx
|
let buffer_source = ctx
|
||||||
@ -158,7 +162,9 @@ static BUFFER_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration
|
|||||||
static TEXTURE_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
static TEXTURE_DESTROY_BEFORE_SUBMIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(
|
.parameters(
|
||||||
// https://github.com/gfx-rs/wgpu/issues/7854
|
// https://github.com/gfx-rs/wgpu/issues/7854
|
||||||
TestParameters::default().skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe")),
|
TestParameters::default()
|
||||||
|
.skip(FailureCase::backend_adapter(Backends::VULKAN, "llvmpipe"))
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let descriptor = wgpu::TextureDescriptor {
|
let descriptor = wgpu::TextureDescriptor {
|
||||||
|
|||||||
@ -310,7 +310,8 @@ static SIMPLE_DRAW_CHECK_MEM_LEAKS: wgpu_test::GpuTestConfiguration =
|
|||||||
.parameters(
|
.parameters(
|
||||||
wgpu_test::TestParameters::default()
|
wgpu_test::TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.features(wgpu::Features::VERTEX_WRITABLE_STORAGE),
|
.features(wgpu::Features::VERTEX_WRITABLE_STORAGE)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_async(|ctx| {
|
.run_async(|ctx| {
|
||||||
draw_test_with_reports(ctx, &[0, 1, 2, 3, 4, 5], |cmb| {
|
draw_test_with_reports(ctx, &[0, 1, 2, 3, 4, 5], |cmb| {
|
||||||
|
|||||||
@ -14,7 +14,11 @@ pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static NV12_TEXTURE_CREATION_SAMPLING: GpuTestConfiguration = GpuTestConfiguration::new()
|
static NV12_TEXTURE_CREATION_SAMPLING: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::TEXTURE_FORMAT_NV12)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
@ -135,7 +139,11 @@ static NV12_TEXTURE_CREATION_SAMPLING: GpuTestConfiguration = GpuTestConfigurati
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static NV12_TEXTURE_VIEW_PLANE_ON_NON_PLANAR_FORMAT: GpuTestConfiguration =
|
static NV12_TEXTURE_VIEW_PLANE_ON_NON_PLANAR_FORMAT: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::TEXTURE_FORMAT_NV12)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
@ -166,7 +174,11 @@ static NV12_TEXTURE_VIEW_PLANE_ON_NON_PLANAR_FORMAT: GpuTestConfiguration =
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static NV12_TEXTURE_VIEW_PLANE_OUT_OF_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new()
|
static NV12_TEXTURE_VIEW_PLANE_OUT_OF_BOUNDS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::TEXTURE_FORMAT_NV12)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
@ -198,7 +210,11 @@ static NV12_TEXTURE_VIEW_PLANE_OUT_OF_BOUNDS: GpuTestConfiguration = GpuTestConf
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::TEXTURE_FORMAT_NV12)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
@ -230,7 +246,11 @@ static NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE: GpuTestConfiguration = GpuTestConfigu
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static NV12_TEXTURE_BAD_SIZE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static NV12_TEXTURE_BAD_SIZE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.features(wgpu::Features::TEXTURE_FORMAT_NV12)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let size = wgpu::Extent3d {
|
let size = wgpu::Extent3d {
|
||||||
width: 255,
|
width: 255,
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const TRIVIAL_FRAGMENT_SHADER_DESC: wgpu::ShaderModuleDescriptor = wgpu::ShaderM
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration =
|
static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
|
|
||||||
@ -72,7 +72,11 @@ static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration =
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration =
|
static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
|
|
||||||
@ -101,7 +105,7 @@ static COMPUTE_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration =
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration =
|
static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
|
|
||||||
@ -138,7 +142,11 @@ static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration =
|
|||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration =
|
static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration =
|
||||||
GpuTestConfiguration::new()
|
GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
|
|
||||||
@ -186,7 +194,7 @@ static RENDER_PIPELINE_DEFAULT_LAYOUT_BAD_BGL_INDEX: GpuTestConfiguration =
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static NO_TARGETLESS_RENDER: GpuTestConfiguration = GpuTestConfiguration::new()
|
static NO_TARGETLESS_RENDER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
fail(
|
fail(
|
||||||
&ctx.device,
|
&ctx.device,
|
||||||
|
|||||||
@ -6,7 +6,9 @@ use wgpu::{
|
|||||||
CommandEncoderDescriptor, ComputePassDescriptor, PollType, ShaderStages,
|
CommandEncoderDescriptor, ComputePassDescriptor, PollType, ShaderStages,
|
||||||
};
|
};
|
||||||
|
|
||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestingContext};
|
use wgpu_test::{
|
||||||
|
gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext,
|
||||||
|
};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.extend([
|
vec.extend([
|
||||||
@ -64,16 +66,19 @@ fn generate_dummy_work(ctx: &TestingContext) -> CommandBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static WAIT: GpuTestConfiguration = GpuTestConfiguration::new().run_async(|ctx| async move {
|
static WAIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let cmd_buf = generate_dummy_work(&ctx);
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
|
let cmd_buf = generate_dummy_work(&ctx);
|
||||||
|
|
||||||
ctx.queue.submit(Some(cmd_buf));
|
ctx.queue.submit(Some(cmd_buf));
|
||||||
ctx.async_poll(PollType::wait()).await.unwrap();
|
ctx.async_poll(PollType::wait()).await.unwrap();
|
||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DOUBLE_WAIT: GpuTestConfiguration =
|
static DOUBLE_WAIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let cmd_buf = generate_dummy_work(&ctx);
|
let cmd_buf = generate_dummy_work(&ctx);
|
||||||
|
|
||||||
ctx.queue.submit(Some(cmd_buf));
|
ctx.queue.submit(Some(cmd_buf));
|
||||||
@ -82,8 +87,9 @@ static DOUBLE_WAIT: GpuTestConfiguration =
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static WAIT_ON_SUBMISSION: GpuTestConfiguration =
|
static WAIT_ON_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let cmd_buf = generate_dummy_work(&ctx);
|
let cmd_buf = generate_dummy_work(&ctx);
|
||||||
|
|
||||||
let index = ctx.queue.submit(Some(cmd_buf));
|
let index = ctx.queue.submit(Some(cmd_buf));
|
||||||
@ -91,8 +97,9 @@ static WAIT_ON_SUBMISSION: GpuTestConfiguration =
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DOUBLE_WAIT_ON_SUBMISSION: GpuTestConfiguration =
|
static DOUBLE_WAIT_ON_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let cmd_buf = generate_dummy_work(&ctx);
|
let cmd_buf = generate_dummy_work(&ctx);
|
||||||
|
|
||||||
let index = ctx.queue.submit(Some(cmd_buf));
|
let index = ctx.queue.submit(Some(cmd_buf));
|
||||||
@ -103,8 +110,9 @@ static DOUBLE_WAIT_ON_SUBMISSION: GpuTestConfiguration =
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static WAIT_OUT_OF_ORDER: GpuTestConfiguration =
|
static WAIT_OUT_OF_ORDER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let cmd_buf1 = generate_dummy_work(&ctx);
|
let cmd_buf1 = generate_dummy_work(&ctx);
|
||||||
let cmd_buf2 = generate_dummy_work(&ctx);
|
let cmd_buf2 = generate_dummy_work(&ctx);
|
||||||
|
|
||||||
@ -120,7 +128,11 @@ static WAIT_OUT_OF_ORDER: GpuTestConfiguration =
|
|||||||
/// console.
|
/// console.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static WAIT_AFTER_BAD_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new()
|
static WAIT_AFTER_BAD_SUBMISSION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(wgpu_test::TestParameters::default().skip(wgpu_test::FailureCase::webgl2()))
|
.parameters(
|
||||||
|
wgpu_test::TestParameters::default()
|
||||||
|
.skip(wgpu_test::FailureCase::webgl2())
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(wait_after_bad_submission);
|
.run_async(wait_after_bad_submission);
|
||||||
|
|
||||||
async fn wait_after_bad_submission(ctx: TestingContext) {
|
async fn wait_after_bad_submission(ctx: TestingContext) {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DROP_FAILED_TIMESTAMP_QUERY_SET: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DROP_FAILED_TIMESTAMP_QUERY_SET: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
// Enter an error scope, so the validation catch-all doesn't
|
// Enter an error scope, so the validation catch-all doesn't
|
||||||
// report the error too early.
|
// report the error too early.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//! Tests for buffer copy validation.
|
//! Tests for buffer copy validation.
|
||||||
|
|
||||||
use wgpu::PollType;
|
use wgpu::PollType;
|
||||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.extend([
|
vec.extend([
|
||||||
@ -13,6 +13,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static QUEUE_WRITE_TEXTURE_THEN_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new()
|
static QUEUE_WRITE_TEXTURE_THEN_DESTROY: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
@ -61,8 +62,9 @@ static QUEUE_WRITE_TEXTURE_THEN_DESTROY: GpuTestConfiguration = GpuTestConfigura
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static QUEUE_WRITE_TEXTURE_OVERFLOW: GpuTestConfiguration =
|
static QUEUE_WRITE_TEXTURE_OVERFLOW: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_sync(|ctx| {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_sync(|ctx| {
|
||||||
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
size: wgpu::Extent3d {
|
size: wgpu::Extent3d {
|
||||||
|
|||||||
@ -66,7 +66,8 @@ static UNBUILT_BLAS_COMPACTION: GpuTestConfiguration = GpuTestConfiguration::new
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(unbuilt_blas_compaction);
|
.run_sync(unbuilt_blas_compaction);
|
||||||
|
|
||||||
@ -128,7 +129,8 @@ static UNPREPARED_BLAS_COMPACTION: GpuTestConfiguration = GpuTestConfiguration::
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(unprepared_blas_compaction);
|
.run_sync(unprepared_blas_compaction);
|
||||||
|
|
||||||
@ -295,7 +297,8 @@ static OUT_OF_ORDER_AS_BUILD_USE: GpuTestConfiguration = GpuTestConfiguration::n
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(out_of_order_as_build_use);
|
.run_sync(out_of_order_as_build_use);
|
||||||
|
|
||||||
@ -477,7 +480,8 @@ static EMPTY_BUILD: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(empty_build);
|
.run_sync(empty_build);
|
||||||
fn empty_build(ctx: TestingContext) {
|
fn empty_build(ctx: TestingContext) {
|
||||||
@ -498,7 +502,8 @@ static BUILD_WITH_TRANSFORM: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(build_with_transform);
|
.run_sync(build_with_transform);
|
||||||
|
|
||||||
@ -710,7 +715,8 @@ static ONLY_TLAS_VERTEX_RETURN: GpuTestConfiguration = GpuTestConfiguration::new
|
|||||||
.features(
|
.features(
|
||||||
wgpu::Features::EXPERIMENTAL_RAY_QUERY
|
wgpu::Features::EXPERIMENTAL_RAY_QUERY
|
||||||
| wgpu::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN,
|
| wgpu::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN,
|
||||||
),
|
)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(only_tlas_vertex_return);
|
.run_sync(only_tlas_vertex_return);
|
||||||
|
|
||||||
@ -749,7 +755,8 @@ static EXTRA_FORMAT_BUILD: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
.features(
|
.features(
|
||||||
wgpu::Features::EXPERIMENTAL_RAY_QUERY
|
wgpu::Features::EXPERIMENTAL_RAY_QUERY
|
||||||
| wgpu::Features::EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS,
|
| wgpu::Features::EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS,
|
||||||
),
|
)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Snorm16x4, 6, false));
|
.run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Snorm16x4, 6, false));
|
||||||
|
|
||||||
@ -759,7 +766,8 @@ static MISALIGNED_BUILD: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
// Larger than the minimum size, but not aligned as required
|
// Larger than the minimum size, but not aligned as required
|
||||||
.run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Float32x3, 13, true));
|
.run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Float32x3, 13, true));
|
||||||
@ -770,7 +778,8 @@ static TOO_SMALL_STRIDE_BUILD: GpuTestConfiguration = GpuTestConfiguration::new(
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
// Aligned as required, but smaller than minimum size
|
// Aligned as required, but smaller than minimum size
|
||||||
.run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Float32x3, 8, true));
|
.run_sync(|ctx| test_as_build_format_stride(ctx, VertexFormat::Float32x3, 8, true));
|
||||||
|
|||||||
@ -18,7 +18,8 @@ static BLAS_INVALID_VERTEX_FORMAT: GpuTestConfiguration = GpuTestConfiguration::
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(invalid_vertex_format_blas_create);
|
.run_sync(invalid_vertex_format_blas_create);
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ static BLAS_MISMATCHED_INDEX: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(mismatched_index_blas_create);
|
.run_sync(mismatched_index_blas_create);
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,8 @@ static LIMITS_HIT: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
max_acceleration_structures_per_shader_stage: 1,
|
max_acceleration_structures_per_shader_stage: 1,
|
||||||
..Limits::default()
|
..Limits::default()
|
||||||
})
|
})
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(hit_limits);
|
.run_sync(hit_limits);
|
||||||
|
|
||||||
|
|||||||
@ -110,7 +110,8 @@ static ACCELERATION_STRUCTURE_BUILD_NO_INDEX: GpuTestConfiguration = GpuTestConf
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
acceleration_structure_build(&ctx, false);
|
acceleration_structure_build(&ctx, false);
|
||||||
@ -122,7 +123,8 @@ static ACCELERATION_STRUCTURE_BUILD_WITH_INDEX: GpuTestConfiguration = GpuTestCo
|
|||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.limits(acceleration_structure_limits())
|
.limits(acceleration_structure_limits())
|
||||||
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY),
|
.features(wgpu::Features::EXPERIMENTAL_RAY_QUERY)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
acceleration_structure_build(&ctx, true);
|
acceleration_structure_build(&ctx, true);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
use wgpu::*;
|
use wgpu::*;
|
||||||
|
|
||||||
@ -19,8 +19,9 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
/// We use non-consecutive vertex attribute locations (0 and 5) in order to also test
|
/// We use non-consecutive vertex attribute locations (0 and 5) in order to also test
|
||||||
/// that we unset the correct locations (see PR #3706).
|
/// that we unset the correct locations (see PR #3706).
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static PASS_RESET_VERTEX_BUFFER: GpuTestConfiguration =
|
static PASS_RESET_VERTEX_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let module = ctx
|
let module = ctx
|
||||||
.device
|
.device
|
||||||
.create_shader_module(include_wgsl!("issue_3457.wgsl"));
|
.create_shader_module(include_wgsl!("issue_3457.wgsl"));
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
use wgpu::*;
|
use wgpu::*;
|
||||||
|
|
||||||
@ -18,6 +18,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
/// to add them to. This is incorrect, as we do not immediately invoke map_async callbacks.
|
/// to add them to. This is incorrect, as we do not immediately invoke map_async callbacks.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static QUEUE_SUBMITTED_CALLBACK_ORDERING: GpuTestConfiguration = GpuTestConfiguration::new()
|
static QUEUE_SUBMITTED_CALLBACK_ORDERING: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
// Create a mappable buffer
|
// Create a mappable buffer
|
||||||
let buffer = ctx.device.create_buffer(&BufferDescriptor {
|
let buffer = ctx.device.create_buffer(&BufferDescriptor {
|
||||||
|
|||||||
@ -91,7 +91,7 @@ async fn fill_test(ctx: &TestingContext, range: Range<u64>, size: u64) -> bool {
|
|||||||
/// This test will fail on nvidia if the bug is not properly worked around.
|
/// This test will fail on nvidia if the bug is not properly worked around.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static CLEAR_BUFFER_RANGE_RESPECTED: GpuTestConfiguration = GpuTestConfiguration::new()
|
static CLEAR_BUFFER_RANGE_RESPECTED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
// This hits most of the cases in nvidia's clear buffer bug
|
// This hits most of the cases in nvidia's clear buffer bug
|
||||||
let mut succeeded = true;
|
let mut succeeded = true;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
/// This also tests that shaders generated with this fix execute correctly.
|
/// This also tests that shaders generated with this fix execute correctly.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static CONTINUE_SWITCH: GpuTestConfiguration = GpuTestConfiguration::new()
|
static CONTINUE_SWITCH: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().force_fxc(true))
|
.parameters(TestParameters::default().force_fxc(true).enable_noop())
|
||||||
.run_async(|ctx| async move { test_impl(&ctx).await });
|
.run_async(|ctx| async move { test_impl(&ctx).await });
|
||||||
|
|
||||||
async fn test_impl(ctx: &TestingContext) {
|
async fn test_impl(ctx: &TestingContext) {
|
||||||
|
|||||||
@ -16,7 +16,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
/// bug is avoided there.
|
/// bug is avoided there.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEGENERATE_SWITCH: GpuTestConfiguration = GpuTestConfiguration::new()
|
static DEGENERATE_SWITCH: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().force_fxc(true))
|
.parameters(TestParameters::default().force_fxc(true).enable_noop())
|
||||||
.run_async(|ctx| async move { test_impl(&ctx).await });
|
.run_async(|ctx| async move { test_impl(&ctx).await });
|
||||||
|
|
||||||
async fn test_impl(ctx: &TestingContext) {
|
async fn test_impl(ctx: &TestingContext) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
use wgpu::*;
|
use wgpu::*;
|
||||||
|
|
||||||
@ -14,8 +14,9 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
/// the fragment inputs. This is necessary for generating correct hlsl:
|
/// the fragment inputs. This is necessary for generating correct hlsl:
|
||||||
/// https://github.com/gfx-rs/wgpu/issues/5553
|
/// https://github.com/gfx-rs/wgpu/issues/5553
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static ALLOW_INPUT_NOT_CONSUMED: GpuTestConfiguration =
|
static ALLOW_INPUT_NOT_CONSUMED: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let module = ctx
|
let module = ctx
|
||||||
.device
|
.device
|
||||||
.create_shader_module(include_wgsl!("issue_5553.wgsl"));
|
.create_shader_module(include_wgsl!("issue_5553.wgsl"));
|
||||||
|
|||||||
@ -11,7 +11,8 @@ static NON_FATAL_ERRORS_IN_QUEUE_SUBMIT: GpuTestConfiguration = GpuTestConfigura
|
|||||||
.parameters(
|
.parameters(
|
||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.downlevel_flags(DownlevelFlags::COMPUTE_SHADERS)
|
.downlevel_flags(DownlevelFlags::COMPUTE_SHADERS)
|
||||||
.limits(Limits::downlevel_defaults()),
|
.limits(Limits::downlevel_defaults())
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let shader_with_trivial_bind_group = concat!(
|
let shader_with_trivial_bind_group = concat!(
|
||||||
|
|||||||
@ -13,7 +13,11 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
/// The following test should successfully do nothing on all platforms.
|
/// The following test should successfully do nothing on all platforms.
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static ZERO_WORKGROUP_COUNT: GpuTestConfiguration = GpuTestConfiguration::new()
|
static ZERO_WORKGROUP_COUNT: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().limits(wgpu::Limits::default()))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.limits(wgpu::Limits::default())
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
let module = ctx
|
let module = ctx
|
||||||
.device
|
.device
|
||||||
|
|||||||
@ -268,7 +268,11 @@ async fn render_pass_query_set_ownership_timestamps(ctx: TestingContext) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static RENDER_PASS_KEEP_ENCODER_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new()
|
static RENDER_PASS_KEEP_ENCODER_ALIVE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().test_features_limits())
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.test_features_limits()
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(render_pass_keep_encoder_alive);
|
.run_async(render_pass_keep_encoder_alive);
|
||||||
|
|
||||||
async fn render_pass_keep_encoder_alive(ctx: TestingContext) {
|
async fn render_pass_keep_encoder_alive(ctx: TestingContext) {
|
||||||
|
|||||||
@ -1,21 +1,23 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.push(BUFFER_SIZE_AND_USAGE);
|
vec.push(BUFFER_SIZE_AND_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BUFFER_SIZE_AND_USAGE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static BUFFER_SIZE_AND_USAGE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
label: None,
|
.run_sync(|ctx| {
|
||||||
size: 1234,
|
let buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
usage: wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST,
|
label: None,
|
||||||
mapped_at_creation: false,
|
size: 1234,
|
||||||
});
|
usage: wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST,
|
||||||
|
mapped_at_creation: false,
|
||||||
|
});
|
||||||
|
|
||||||
assert_eq!(buffer.size(), 1234);
|
assert_eq!(buffer.size(), 1234);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
buffer.usage(),
|
buffer.usage(),
|
||||||
wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST
|
wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,70 +1,74 @@
|
|||||||
use wgpu_test::{fail, gpu_test, valid, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{fail, gpu_test, valid, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.extend([BAD_BUFFER, BAD_TEXTURE]);
|
vec.extend([BAD_BUFFER, BAD_TEXTURE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BAD_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static BAD_BUFFER: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
// Create a buffer with bad parameters and call a few methods.
|
.parameters(TestParameters::default().enable_noop())
|
||||||
// Validation should fail but there should be not panic.
|
.run_sync(|ctx| {
|
||||||
let buffer = fail(
|
// Create a buffer with bad parameters and call a few methods.
|
||||||
&ctx.device,
|
// Validation should fail but there should be not panic.
|
||||||
|| {
|
let buffer = fail(
|
||||||
ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
&ctx.device,
|
||||||
label: None,
|
|| {
|
||||||
size: 99999999,
|
ctx.device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::STORAGE,
|
label: None,
|
||||||
mapped_at_creation: false,
|
size: 99999999,
|
||||||
})
|
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::STORAGE,
|
||||||
},
|
mapped_at_creation: false,
|
||||||
Some("`map` usage can only be combined with the opposite `copy`"),
|
})
|
||||||
);
|
},
|
||||||
|
Some("`map` usage can only be combined with the opposite `copy`"),
|
||||||
|
);
|
||||||
|
|
||||||
fail(
|
fail(
|
||||||
&ctx.device,
|
&ctx.device,
|
||||||
|| buffer.slice(..).map_async(wgpu::MapMode::Write, |_| {}),
|
|| buffer.slice(..).map_async(wgpu::MapMode::Write, |_| {}),
|
||||||
Some("Buffer with '' label is invalid"),
|
Some("Buffer with '' label is invalid"),
|
||||||
);
|
);
|
||||||
fail(
|
fail(
|
||||||
&ctx.device,
|
&ctx.device,
|
||||||
|| buffer.unmap(),
|
|| buffer.unmap(),
|
||||||
Some("Buffer with '' label is invalid"),
|
Some("Buffer with '' label is invalid"),
|
||||||
);
|
);
|
||||||
valid(&ctx.device, || buffer.destroy());
|
valid(&ctx.device, || buffer.destroy());
|
||||||
valid(&ctx.device, || buffer.destroy());
|
valid(&ctx.device, || buffer.destroy());
|
||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BAD_TEXTURE: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static BAD_TEXTURE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let texture = fail(
|
.parameters(TestParameters::default().enable_noop())
|
||||||
&ctx.device,
|
.run_sync(|ctx| {
|
||||||
|| {
|
let texture = fail(
|
||||||
ctx.device.create_texture(&wgpu::TextureDescriptor {
|
&ctx.device,
|
||||||
label: None,
|
|| {
|
||||||
size: wgpu::Extent3d {
|
ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
width: 0,
|
label: None,
|
||||||
height: 12345678,
|
size: wgpu::Extent3d {
|
||||||
depth_or_array_layers: 9001,
|
width: 0,
|
||||||
},
|
height: 12345678,
|
||||||
mip_level_count: 2000,
|
depth_or_array_layers: 9001,
|
||||||
sample_count: 27,
|
},
|
||||||
dimension: wgpu::TextureDimension::D2,
|
mip_level_count: 2000,
|
||||||
format: wgpu::TextureFormat::Rgba8UnormSrgb,
|
sample_count: 27,
|
||||||
usage: wgpu::TextureUsages::all(),
|
dimension: wgpu::TextureDimension::D2,
|
||||||
view_formats: &[],
|
format: wgpu::TextureFormat::Rgba8UnormSrgb,
|
||||||
})
|
usage: wgpu::TextureUsages::all(),
|
||||||
},
|
view_formats: &[],
|
||||||
Some("dimension x is zero"),
|
})
|
||||||
);
|
},
|
||||||
|
Some("dimension x is zero"),
|
||||||
|
);
|
||||||
|
|
||||||
fail(
|
fail(
|
||||||
&ctx.device,
|
&ctx.device,
|
||||||
|| {
|
|| {
|
||||||
let _ = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
let _ = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||||
},
|
},
|
||||||
Some("Texture with '' label is invalid"),
|
Some("Texture with '' label is invalid"),
|
||||||
);
|
);
|
||||||
valid(&ctx.device, || texture.destroy());
|
valid(&ctx.device, || texture.destroy());
|
||||||
valid(&ctx.device, || texture.destroy());
|
valid(&ctx.device, || texture.destroy());
|
||||||
});
|
});
|
||||||
|
|||||||
@ -21,8 +21,9 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
const PROBABLY_PROBLEMATIC_SAMPLER_COUNT: u32 = 8 * 1024;
|
const PROBABLY_PROBLEMATIC_SAMPLER_COUNT: u32 = 8 * 1024;
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static SAMPLER_DEDUPLICATION: GpuTestConfiguration =
|
static SAMPLER_DEDUPLICATION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_sync(sampler_deduplication);
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_sync(sampler_deduplication);
|
||||||
|
|
||||||
// Create a large number of samplers from the same two descriptors.
|
// Create a large number of samplers from the same two descriptors.
|
||||||
//
|
//
|
||||||
@ -71,8 +72,9 @@ fn sampler_deduplication(ctx: TestingContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static SAMPLER_CREATION_FAILURE: GpuTestConfiguration =
|
static SAMPLER_CREATION_FAILURE: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_sync(sampler_creation_failure);
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_sync(sampler_creation_failure);
|
||||||
|
|
||||||
/// We want to test that sampler creation properly fails when we hit internal sampler
|
/// We want to test that sampler creation properly fails when we hit internal sampler
|
||||||
/// cache limits. As we don't actually know what the limit is, we first create as many
|
/// cache limits. As we don't actually know what the limit is, we first create as many
|
||||||
|
|||||||
@ -8,7 +8,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static SHADER_COMPILE_SUCCESS: GpuTestConfiguration = GpuTestConfiguration::new()
|
static SHADER_COMPILE_SUCCESS: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
let sm = ctx
|
let sm = ctx
|
||||||
.device
|
.device
|
||||||
@ -22,7 +22,7 @@ static SHADER_COMPILE_SUCCESS: GpuTestConfiguration = GpuTestConfiguration::new(
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static SHADER_COMPILE_ERROR: GpuTestConfiguration = GpuTestConfiguration::new()
|
static SHADER_COMPILE_ERROR: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default())
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
||||||
let sm = ctx
|
let sm = ctx
|
||||||
|
|||||||
@ -18,7 +18,8 @@ static TEXTURE_BINDING: GpuTestConfiguration = GpuTestConfiguration::new()
|
|||||||
.parameters(
|
.parameters(
|
||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.test_features_limits()
|
.test_features_limits()
|
||||||
.downlevel_flags(DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT),
|
.downlevel_flags(DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT)
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_sync(texture_binding);
|
.run_sync(texture_binding);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.extend([
|
vec.extend([
|
||||||
@ -9,6 +9,7 @@ pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static TEXTURE_BLIT_WITH_LINEAR_FILTER_TEST: GpuTestConfiguration = GpuTestConfiguration::new()
|
static TEXTURE_BLIT_WITH_LINEAR_FILTER_TEST: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let source = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let source = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
@ -60,6 +61,7 @@ static TEXTURE_BLIT_WITH_LINEAR_FILTER_TEST: GpuTestConfiguration = GpuTestConfi
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static TEXTURE_BLIT_WITH_NEAREST_FILTER_TEST: GpuTestConfiguration = GpuTestConfiguration::new()
|
static TEXTURE_BLIT_WITH_NEAREST_FILTER_TEST: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.run_sync(|ctx| {
|
.run_sync(|ctx| {
|
||||||
let source = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let source = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
|
|||||||
@ -1,95 +1,97 @@
|
|||||||
//! Tests for texture copy bounds checks.
|
//! Tests for texture copy bounds checks.
|
||||||
|
|
||||||
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration};
|
use wgpu_test::{fail_if, gpu_test, GpuTestConfiguration, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<wgpu_test::GpuTestInitializer>) {
|
||||||
vec.push(BAD_COPY_ORIGIN_TEST);
|
vec.push(BAD_COPY_ORIGIN_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static BAD_COPY_ORIGIN_TEST: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static BAD_COPY_ORIGIN_TEST: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let try_origin = |origin, size, should_panic| {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
let texture = ctx.device.create_texture(&TEXTURE_DESCRIPTOR);
|
.run_sync(|ctx| {
|
||||||
let data = vec![255; BUFFER_SIZE as usize];
|
let try_origin = |origin, size, should_panic| {
|
||||||
|
let texture = ctx.device.create_texture(&TEXTURE_DESCRIPTOR);
|
||||||
|
let data = vec![255; BUFFER_SIZE as usize];
|
||||||
|
|
||||||
fail_if(
|
fail_if(
|
||||||
&ctx.device,
|
&ctx.device,
|
||||||
should_panic,
|
should_panic,
|
||||||
|| {
|
|| {
|
||||||
ctx.queue.write_texture(
|
ctx.queue.write_texture(
|
||||||
wgpu::TexelCopyTextureInfo {
|
wgpu::TexelCopyTextureInfo {
|
||||||
texture: &texture,
|
texture: &texture,
|
||||||
mip_level: 0,
|
mip_level: 0,
|
||||||
origin,
|
origin,
|
||||||
aspect: wgpu::TextureAspect::All,
|
aspect: wgpu::TextureAspect::All,
|
||||||
},
|
},
|
||||||
&data,
|
&data,
|
||||||
BUFFER_COPY_LAYOUT,
|
BUFFER_COPY_LAYOUT,
|
||||||
size,
|
size,
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
try_origin(wgpu::Origin3d { x: 0, y: 0, z: 0 }, TEXTURE_SIZE, false);
|
||||||
|
try_origin(wgpu::Origin3d { x: 1, y: 0, z: 0 }, TEXTURE_SIZE, true);
|
||||||
|
try_origin(wgpu::Origin3d { x: 0, y: 1, z: 0 }, TEXTURE_SIZE, true);
|
||||||
|
try_origin(wgpu::Origin3d { x: 0, y: 0, z: 1 }, TEXTURE_SIZE, true);
|
||||||
|
|
||||||
|
try_origin(
|
||||||
|
wgpu::Origin3d {
|
||||||
|
x: TEXTURE_SIZE.width - 1,
|
||||||
|
y: TEXTURE_SIZE.height - 1,
|
||||||
|
z: TEXTURE_SIZE.depth_or_array_layers - 1,
|
||||||
},
|
},
|
||||||
None,
|
wgpu::Extent3d {
|
||||||
|
width: 1,
|
||||||
|
height: 1,
|
||||||
|
depth_or_array_layers: 1,
|
||||||
|
},
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
};
|
try_origin(
|
||||||
|
wgpu::Origin3d {
|
||||||
try_origin(wgpu::Origin3d { x: 0, y: 0, z: 0 }, TEXTURE_SIZE, false);
|
x: u32::MAX,
|
||||||
try_origin(wgpu::Origin3d { x: 1, y: 0, z: 0 }, TEXTURE_SIZE, true);
|
y: 0,
|
||||||
try_origin(wgpu::Origin3d { x: 0, y: 1, z: 0 }, TEXTURE_SIZE, true);
|
z: 0,
|
||||||
try_origin(wgpu::Origin3d { x: 0, y: 0, z: 1 }, TEXTURE_SIZE, true);
|
},
|
||||||
|
wgpu::Extent3d {
|
||||||
try_origin(
|
width: 1,
|
||||||
wgpu::Origin3d {
|
height: 1,
|
||||||
x: TEXTURE_SIZE.width - 1,
|
depth_or_array_layers: 1,
|
||||||
y: TEXTURE_SIZE.height - 1,
|
},
|
||||||
z: TEXTURE_SIZE.depth_or_array_layers - 1,
|
true,
|
||||||
},
|
);
|
||||||
wgpu::Extent3d {
|
try_origin(
|
||||||
width: 1,
|
wgpu::Origin3d {
|
||||||
height: 1,
|
x: u32::MAX,
|
||||||
depth_or_array_layers: 1,
|
y: 0,
|
||||||
},
|
z: 0,
|
||||||
false,
|
},
|
||||||
);
|
wgpu::Extent3d {
|
||||||
try_origin(
|
width: 1,
|
||||||
wgpu::Origin3d {
|
height: 1,
|
||||||
x: u32::MAX,
|
depth_or_array_layers: 1,
|
||||||
y: 0,
|
},
|
||||||
z: 0,
|
true,
|
||||||
},
|
);
|
||||||
wgpu::Extent3d {
|
try_origin(
|
||||||
width: 1,
|
wgpu::Origin3d {
|
||||||
height: 1,
|
x: u32::MAX,
|
||||||
depth_or_array_layers: 1,
|
y: 0,
|
||||||
},
|
z: 0,
|
||||||
true,
|
},
|
||||||
);
|
wgpu::Extent3d {
|
||||||
try_origin(
|
width: 1,
|
||||||
wgpu::Origin3d {
|
height: 1,
|
||||||
x: u32::MAX,
|
depth_or_array_layers: 1,
|
||||||
y: 0,
|
},
|
||||||
z: 0,
|
true,
|
||||||
},
|
);
|
||||||
wgpu::Extent3d {
|
});
|
||||||
width: 1,
|
|
||||||
height: 1,
|
|
||||||
depth_or_array_layers: 1,
|
|
||||||
},
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
try_origin(
|
|
||||||
wgpu::Origin3d {
|
|
||||||
x: u32::MAX,
|
|
||||||
y: 0,
|
|
||||||
z: 0,
|
|
||||||
},
|
|
||||||
wgpu::Extent3d {
|
|
||||||
width: 1,
|
|
||||||
height: 1,
|
|
||||||
depth_or_array_layers: 1,
|
|
||||||
},
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const TEXTURE_SIZE: wgpu::Extent3d = wgpu::Extent3d {
|
const TEXTURE_SIZE: wgpu::Extent3d = wgpu::Extent3d {
|
||||||
width: 64,
|
width: 64,
|
||||||
|
|||||||
@ -14,7 +14,8 @@ static STENCIL_ONLY_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::
|
|||||||
.parameters(
|
.parameters(
|
||||||
TestParameters::default()
|
TestParameters::default()
|
||||||
.skip(FailureCase::webgl2()) // WebGL doesn't have stencil only views
|
.skip(FailureCase::webgl2()) // WebGL doesn't have stencil only views
|
||||||
.limits(wgpu::Limits::downlevel_defaults()),
|
.limits(wgpu::Limits::downlevel_defaults())
|
||||||
|
.enable_noop(),
|
||||||
)
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
for format in [TextureFormat::Stencil8, TextureFormat::Depth24PlusStencil8] {
|
for format in [TextureFormat::Stencil8, TextureFormat::Depth24PlusStencil8] {
|
||||||
@ -42,8 +43,9 @@ static STENCIL_ONLY_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static DEPTH_ONLY_VIEW_CREATION: GpuTestConfiguration =
|
static DEPTH_ONLY_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
for format in [
|
for format in [
|
||||||
TextureFormat::Depth16Unorm,
|
TextureFormat::Depth16Unorm,
|
||||||
TextureFormat::Depth24Plus,
|
TextureFormat::Depth24Plus,
|
||||||
@ -74,7 +76,11 @@ static DEPTH_ONLY_VIEW_CREATION: GpuTestConfiguration =
|
|||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static SHARED_USAGE_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::new()
|
static SHARED_USAGE_VIEW_CREATION: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
.parameters(TestParameters::default().downlevel_flags(DownlevelFlags::VIEW_FORMATS))
|
.parameters(
|
||||||
|
TestParameters::default()
|
||||||
|
.downlevel_flags(DownlevelFlags::VIEW_FORMATS)
|
||||||
|
.enable_noop(),
|
||||||
|
)
|
||||||
.run_async(|ctx| async move {
|
.run_async(|ctx| async move {
|
||||||
{
|
{
|
||||||
let (texture_format, view_format) =
|
let (texture_format, view_format) =
|
||||||
|
|||||||
@ -1,73 +1,75 @@
|
|||||||
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{fail, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.push(COPY_OVERFLOW_Z);
|
vec.push(COPY_OVERFLOW_Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static COPY_OVERFLOW_Z: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static COPY_OVERFLOW_Z: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let mut encoder = ctx
|
.parameters(TestParameters::default().enable_noop())
|
||||||
.device
|
.run_sync(|ctx| {
|
||||||
.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
|
let mut encoder = ctx
|
||||||
|
.device
|
||||||
|
.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
|
||||||
|
|
||||||
let t1 = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let t1 = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
dimension: wgpu::TextureDimension::D2,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
size: wgpu::Extent3d {
|
size: wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
height: 256,
|
height: 256,
|
||||||
depth_or_array_layers: 1,
|
depth_or_array_layers: 1,
|
||||||
},
|
},
|
||||||
format: wgpu::TextureFormat::Rgba8Uint,
|
format: wgpu::TextureFormat::Rgba8Uint,
|
||||||
usage: wgpu::TextureUsages::COPY_DST,
|
usage: wgpu::TextureUsages::COPY_DST,
|
||||||
mip_level_count: 1,
|
mip_level_count: 1,
|
||||||
sample_count: 1,
|
sample_count: 1,
|
||||||
view_formats: &[],
|
view_formats: &[],
|
||||||
});
|
});
|
||||||
let t2 = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let t2 = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
dimension: wgpu::TextureDimension::D2,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
size: wgpu::Extent3d {
|
size: wgpu::Extent3d {
|
||||||
width: 256,
|
width: 256,
|
||||||
height: 256,
|
height: 256,
|
||||||
depth_or_array_layers: 1,
|
depth_or_array_layers: 1,
|
||||||
},
|
},
|
||||||
format: wgpu::TextureFormat::Rgba8Uint,
|
format: wgpu::TextureFormat::Rgba8Uint,
|
||||||
usage: wgpu::TextureUsages::COPY_DST,
|
usage: wgpu::TextureUsages::COPY_DST,
|
||||||
mip_level_count: 1,
|
mip_level_count: 1,
|
||||||
sample_count: 1,
|
sample_count: 1,
|
||||||
view_formats: &[],
|
view_formats: &[],
|
||||||
});
|
});
|
||||||
|
|
||||||
fail(
|
fail(
|
||||||
&ctx.device,
|
&ctx.device,
|
||||||
|| {
|
|| {
|
||||||
// Validation should catch the silly selected z layer range without panicking.
|
// Validation should catch the silly selected z layer range without panicking.
|
||||||
encoder.copy_texture_to_texture(
|
encoder.copy_texture_to_texture(
|
||||||
wgpu::TexelCopyTextureInfo {
|
wgpu::TexelCopyTextureInfo {
|
||||||
texture: &t1,
|
texture: &t1,
|
||||||
mip_level: 1,
|
mip_level: 1,
|
||||||
origin: wgpu::Origin3d::ZERO,
|
origin: wgpu::Origin3d::ZERO,
|
||||||
aspect: wgpu::TextureAspect::All,
|
aspect: wgpu::TextureAspect::All,
|
||||||
},
|
|
||||||
wgpu::TexelCopyTextureInfo {
|
|
||||||
texture: &t2,
|
|
||||||
mip_level: 1,
|
|
||||||
origin: wgpu::Origin3d {
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
z: 3824276442,
|
|
||||||
},
|
},
|
||||||
aspect: wgpu::TextureAspect::All,
|
wgpu::TexelCopyTextureInfo {
|
||||||
},
|
texture: &t2,
|
||||||
wgpu::Extent3d {
|
mip_level: 1,
|
||||||
width: 100,
|
origin: wgpu::Origin3d {
|
||||||
height: 3,
|
x: 0,
|
||||||
depth_or_array_layers: 613286111,
|
y: 0,
|
||||||
},
|
z: 3824276442,
|
||||||
);
|
},
|
||||||
ctx.queue.submit(Some(encoder.finish()));
|
aspect: wgpu::TextureAspect::All,
|
||||||
},
|
},
|
||||||
Some("unable to select texture mip level"),
|
wgpu::Extent3d {
|
||||||
);
|
width: 100,
|
||||||
});
|
height: 3,
|
||||||
|
depth_or_array_layers: 613286111,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
ctx.queue.submit(Some(encoder.finish()));
|
||||||
|
},
|
||||||
|
Some("unable to select texture mip level"),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|||||||
@ -1,39 +1,41 @@
|
|||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.push(TRANSITION_RESOURCES);
|
vec.push(TRANSITION_RESOURCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static TRANSITION_RESOURCES: GpuTestConfiguration = GpuTestConfiguration::new().run_sync(|ctx| {
|
static TRANSITION_RESOURCES: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
label: None,
|
.run_sync(|ctx| {
|
||||||
size: wgpu::Extent3d {
|
let texture = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
width: 32,
|
label: None,
|
||||||
height: 32,
|
size: wgpu::Extent3d {
|
||||||
depth_or_array_layers: 1,
|
width: 32,
|
||||||
},
|
height: 32,
|
||||||
mip_level_count: 1,
|
depth_or_array_layers: 1,
|
||||||
sample_count: 1,
|
},
|
||||||
dimension: wgpu::TextureDimension::D2,
|
mip_level_count: 1,
|
||||||
format: wgpu::TextureFormat::Rgba8Unorm,
|
sample_count: 1,
|
||||||
usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
view_formats: &[],
|
format: wgpu::TextureFormat::Rgba8Unorm,
|
||||||
|
usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING,
|
||||||
|
view_formats: &[],
|
||||||
|
});
|
||||||
|
|
||||||
|
let mut encoder = ctx
|
||||||
|
.device
|
||||||
|
.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
|
||||||
|
|
||||||
|
encoder.transition_resources(
|
||||||
|
std::iter::empty(),
|
||||||
|
[wgpu::TextureTransition {
|
||||||
|
texture: &texture,
|
||||||
|
selector: None,
|
||||||
|
state: wgpu::TextureUses::COLOR_TARGET,
|
||||||
|
}]
|
||||||
|
.into_iter(),
|
||||||
|
);
|
||||||
|
|
||||||
|
ctx.queue.submit([encoder.finish()]);
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut encoder = ctx
|
|
||||||
.device
|
|
||||||
.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
|
|
||||||
|
|
||||||
encoder.transition_resources(
|
|
||||||
std::iter::empty(),
|
|
||||||
[wgpu::TextureTransition {
|
|
||||||
texture: &texture,
|
|
||||||
selector: None,
|
|
||||||
state: wgpu::TextureUses::COLOR_TARGET,
|
|
||||||
}]
|
|
||||||
.into_iter(),
|
|
||||||
);
|
|
||||||
|
|
||||||
ctx.queue.submit([encoder.finish()]);
|
|
||||||
});
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//! Tests for texture copy
|
//! Tests for texture copy
|
||||||
|
|
||||||
use wgpu::*;
|
use wgpu::*;
|
||||||
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer};
|
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
|
||||||
|
|
||||||
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
pub fn all_tests(vec: &mut Vec<GpuTestInitializer>) {
|
||||||
vec.extend([
|
vec.extend([
|
||||||
@ -199,8 +199,9 @@ static WRITE_TEXTURE_SUBSET_3D: GpuTestConfiguration =
|
|||||||
});
|
});
|
||||||
|
|
||||||
#[gpu_test]
|
#[gpu_test]
|
||||||
static WRITE_TEXTURE_NO_OOB: GpuTestConfiguration =
|
static WRITE_TEXTURE_NO_OOB: GpuTestConfiguration = GpuTestConfiguration::new()
|
||||||
GpuTestConfiguration::new().run_async(|ctx| async move {
|
.parameters(TestParameters::default().enable_noop())
|
||||||
|
.run_async(|ctx| async move {
|
||||||
let size = 256;
|
let size = 256;
|
||||||
|
|
||||||
let tex = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
let tex = ctx.device.create_texture(&wgpu::TextureDescriptor {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user