Add a basic test for mismatched devices (#3926)

This commit is contained in:
Nicolas Silva 2023-07-19 23:51:42 +02:00 committed by GitHub
parent 11b8dbbea3
commit 64bf58a056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,3 +9,30 @@ fn device_initialization() {
// intentionally empty
})
}
#[test]
#[ignore]
fn device_mismatch() {
initialize_test(TestParameters::default().failure(), |ctx| {
// Create a bind group uisng a lyaout from another device. This should be a validation
// error but currently crashes.
let (device2, _) =
pollster::block_on(ctx.adapter.request_device(&Default::default(), None)).unwrap();
{
let bind_group_layout =
device2.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: None,
entries: &[],
});
let _bind_group = ctx.device.create_bind_group(&wgpu::BindGroupDescriptor {
label: None,
layout: &bind_group_layout,
entries: &[],
});
}
ctx.device.poll(wgpu::Maintain::Poll);
});
}