move alignments & downlevel .clone()s inside function

This commit is contained in:
teoxoy 2023-11-29 15:44:43 +01:00 committed by Teodor Tanasoaia
parent 6ff5f8e4ad
commit acdc9fcced
2 changed files with 3 additions and 5 deletions

View File

@ -192,8 +192,6 @@ impl<A: HalApi> Device<A> {
raw_device: A::Device,
raw_queue: &A::Queue,
adapter: &Arc<Adapter<A>>,
alignments: hal::Alignments,
downlevel: wgt::DownlevelCapabilities,
desc: &DeviceDescriptor,
trace_path: Option<&std::path::Path>,
instance_flags: wgt::InstanceFlags,
@ -243,6 +241,9 @@ impl<A: HalApi> Device<A> {
}));
}
let alignments = adapter.raw.capabilities.alignments.clone();
let downlevel = adapter.raw.capabilities.downlevel.clone();
Ok(Self {
raw: Some(raw_device),
adapter: adapter.clone(),

View File

@ -309,13 +309,10 @@ impl<A: HalApi> Adapter<A> {
) -> Result<(Device<A>, Queue<A>), RequestDeviceError> {
api_log!("Adapter::create_device");
let caps = &self.raw.capabilities;
if let Ok(device) = Device::new(
hal_device.device,
&hal_device.queue,
self,
caps.alignments.clone(),
caps.downlevel.clone(),
desc,
trace_path,
instance_flags,