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_device: A::Device,
raw_queue: &A::Queue, raw_queue: &A::Queue,
adapter: &Arc<Adapter<A>>, adapter: &Arc<Adapter<A>>,
alignments: hal::Alignments,
downlevel: wgt::DownlevelCapabilities,
desc: &DeviceDescriptor, desc: &DeviceDescriptor,
trace_path: Option<&std::path::Path>, trace_path: Option<&std::path::Path>,
instance_flags: wgt::InstanceFlags, 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 { Ok(Self {
raw: Some(raw_device), raw: Some(raw_device),
adapter: adapter.clone(), adapter: adapter.clone(),

View File

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