[tests] remove Arc around device field of TestingContext

This commit is contained in:
teoxoy 2024-08-02 13:07:56 +02:00 committed by Teodor Tanasoaia
parent 9c6ae1beae
commit a4e7a293d7
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
use std::{panic::AssertUnwindSafe, sync::Arc};
use std::panic::AssertUnwindSafe;
use futures_lite::FutureExt;
use wgpu::{Adapter, Device, Instance, Queue};
@ -18,7 +18,7 @@ pub struct TestingContext {
pub adapter: Adapter,
pub adapter_info: wgpu::AdapterInfo,
pub adapter_downlevel_capabilities: wgpu::DownlevelCapabilities,
pub device: Arc<Device>,
pub device: Device,
pub device_features: wgpu::Features,
pub device_limits: wgpu::Limits,
pub queue: Queue,
@ -73,7 +73,7 @@ pub async fn execute_test(
adapter,
adapter_info,
adapter_downlevel_capabilities,
device: Arc::new(device),
device,
device_features: config.params.required_features,
device_limits: config.params.required_limits.clone(),
queue,

View File

@ -19,8 +19,8 @@ static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration =
.run_sync(|ctx| {
// Use the device after the queue is dropped. Currently this panics
// but it probably shouldn't
let device = ctx.device.clone();
drop(ctx);
let TestingContext { device, queue, .. } = ctx;
drop(queue);
let _encoder =
device.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
});