Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for wgpu#4139. #4148

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/tests/query_set.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use wgpu_test::{initialize_test, FailureCase, TestParameters};

#[test]
fn drop_failed_timestamp_query_set() {
let parameters = TestParameters::default()
// https://github.com/gfx-rs/wgpu/issues/4139
.expect_fail(FailureCase::always());
initialize_test(parameters, |ctx| {
// Enter an error scope, so the validation catch-all doesn't
// report the error too early.
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);

// Creating this query set should fail, since we didn't include
// TIMESTAMP_QUERY in our required features.
let bad_query_set = ctx.device.create_query_set(&wgpu::QuerySetDescriptor {
label: Some("doomed query set"),
ty: wgpu::QueryType::Timestamp,
count: 1,
});

// Dropping this should not panic.
drop(bad_query_set);

assert!(pollster::block_on(ctx.device.pop_error_scope()).is_some());
});
}
1 change: 1 addition & 0 deletions tests/tests/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mod instance;
mod occlusion_query;
mod partially_bounded_arrays;
mod poll;
mod query_set;
mod queue_transfer;
mod resource_descriptor_accessor;
mod resource_error;
Expand Down