diff --git a/examples/src/bin/basic-compute-shader.rs b/examples/src/bin/basic-compute-shader.rs index fcd5ad14..2d959bad 100644 --- a/examples/src/bin/basic-compute-shader.rs +++ b/examples/src/bin/basic-compute-shader.rs @@ -49,7 +49,7 @@ fn main() { // Now initializing the device. let (device, mut queues) = { - Device::new(&physical, physical.supported_features(), &DeviceExtensions::none(), + Device::new(physical, physical.supported_features(), &DeviceExtensions::none(), [(queue, 0.5)].iter().cloned()).expect("failed to create device") }; diff --git a/examples/src/bin/debug.rs b/examples/src/bin/debug.rs index 2080e517..ae39aa9a 100644 --- a/examples/src/bin/debug.rs +++ b/examples/src/bin/debug.rs @@ -93,7 +93,7 @@ fn main() { let physical = PhysicalDevice::enumerate(&instance).next().expect("no device available"); let queue = physical.queue_families().next().expect("couldn't find a queue family"); - let (device, mut queues) = Device::new(&physical, physical.supported_features(), &DeviceExtensions::none(), vec![(queue, 0.5)]).expect("failed to create device"); + let (device, mut queues) = Device::new(physical, physical.supported_features(), &DeviceExtensions::none(), vec![(queue, 0.5)]).expect("failed to create device"); let queue = queues.next().unwrap(); // Create an image in order to generate some additional logging: diff --git a/examples/src/bin/image.rs b/examples/src/bin/image.rs index 169a7d31..b2b1fab6 100644 --- a/examples/src/bin/image.rs +++ b/examples/src/bin/image.rs @@ -48,7 +48,7 @@ fn main() { khr_swapchain: true, .. vulkano::device::DeviceExtensions::none() }; - let (device, mut queues) = vulkano::device::Device::new(&physical, physical.supported_features(), + let (device, mut queues) = vulkano::device::Device::new(physical, physical.supported_features(), &device_ext, [(queue, 0.5)].iter().cloned()) .expect("failed to create device"); let queue = queues.next().unwrap(); diff --git a/examples/src/bin/teapot.rs b/examples/src/bin/teapot.rs index 1d2383d5..79bf4e19 100644 --- a/examples/src/bin/teapot.rs +++ b/examples/src/bin/teapot.rs @@ -49,7 +49,7 @@ fn main() { .. vulkano::device::DeviceExtensions::none() }; - let (device, mut queues) = vulkano::device::Device::new(&physical, physical.supported_features(), + let (device, mut queues) = vulkano::device::Device::new(physical, physical.supported_features(), &device_ext, [(queue, 0.5)].iter().cloned()) .expect("failed to create device"); let queue = queues.next().unwrap(); diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index 1e967e82..078d801a 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -145,7 +145,7 @@ fn main() { .. vulkano::device::DeviceExtensions::none() }; - Device::new(&physical, physical.supported_features(), &device_ext, + Device::new(physical, physical.supported_features(), &device_ext, [(queue, 0.5)].iter().cloned()).expect("failed to create device") }; diff --git a/vulkano/src/device.rs b/vulkano/src/device.rs index 7baf0730..ed4922df 100644 --- a/vulkano/src/device.rs +++ b/vulkano/src/device.rs @@ -38,7 +38,7 @@ //! let features = Features::none(); //! let ext = DeviceExtensions::none(); //! -//! match Device::new(&physical_device, &features, &ext, Some((queue_family, 1.0))) { +//! match Device::new(physical_device, &features, &ext, Some((queue_family, 1.0))) { //! Ok(d) => d, //! Err(err) => panic!("Couldn't build device: {:?}", err) //! } @@ -163,7 +163,7 @@ impl Device { /// // TODO: return Arc and handle synchronization in the Queue // TODO: should take the PhysicalDevice by value - pub fn new<'a, I, Ext>(phys: &'a PhysicalDevice, requested_features: &Features, + pub fn new<'a, I, Ext>(phys: PhysicalDevice, requested_features: &Features, extensions: Ext, queue_families: I) -> Result<(Arc, QueuesIter), DeviceCreationError> where I: IntoIterator, f32)>, @@ -672,7 +672,7 @@ mod tests { let family = physical.queue_families().next().unwrap(); let queues = (0 .. family.queues_count() + 1).map(|_| (family, 1.0)); - match Device::new(&physical, + match Device::new(physical, &Features::none(), &DeviceExtensions::none(), queues) { @@ -697,7 +697,7 @@ mod tests { return; } - match Device::new(&physical, + match Device::new(physical, &features, &DeviceExtensions::none(), Some((family, 1.0))) { @@ -716,7 +716,7 @@ mod tests { let family = physical.queue_families().next().unwrap(); - match Device::new(&physical, + match Device::new(physical, &Features::none(), &DeviceExtensions::none(), Some((family, 1.4))) { @@ -724,7 +724,7 @@ mod tests { _ => panic!(), }; - match Device::new(&physical, + match Device::new(physical, &Features::none(), &DeviceExtensions::none(), Some((family, -0.2))) { diff --git a/vulkano/src/instance/extensions.rs b/vulkano/src/instance/extensions.rs index 73e52225..c3ff8557 100644 --- a/vulkano/src/instance/extensions.rs +++ b/vulkano/src/instance/extensions.rs @@ -245,7 +245,7 @@ macro_rules! device_extensions { impl $rawname { /// See the docs of supported_by_device(). - pub fn supported_by_device_raw(physical_device: &PhysicalDevice) -> Result { + pub fn supported_by_device_raw(physical_device: PhysicalDevice) -> Result { let vk = physical_device.instance().pointers(); let properties: Vec = unsafe { @@ -263,7 +263,7 @@ macro_rules! device_extensions { } /// Returns an `Extensions` object with extensions supported by the `PhysicalDevice`. - pub fn supported_by_device(physical_device: &PhysicalDevice) -> Self { + pub fn supported_by_device(physical_device: PhysicalDevice) -> Self { match $rawname::supported_by_device_raw(physical_device) { Ok(l) => l, Err(SupportedExtensionsError::LoadingError(e)) => unreachable!(), @@ -274,7 +274,7 @@ macro_rules! device_extensions { impl $sname { /// See the docs of supported_by_device(). - pub fn supported_by_device_raw(physical_device: &PhysicalDevice) -> Result { + pub fn supported_by_device_raw(physical_device: PhysicalDevice) -> Result { let vk = physical_device.instance().pointers(); let properties: Vec = unsafe { @@ -304,7 +304,7 @@ macro_rules! device_extensions { } /// Returns an `Extensions` object with extensions supported by the `PhysicalDevice`. - pub fn supported_by_device(physical_device: &PhysicalDevice) -> Self { + pub fn supported_by_device(physical_device: PhysicalDevice) -> Self { match $sname::supported_by_device_raw(physical_device) { Ok(l) => l, Err(SupportedExtensionsError::LoadingError(e)) => unreachable!(), diff --git a/vulkano/src/swapchain/display.rs b/vulkano/src/swapchain/display.rs index 49f54a67..cc85b040 100644 --- a/vulkano/src/swapchain/display.rs +++ b/vulkano/src/swapchain/display.rs @@ -58,7 +58,7 @@ pub struct DisplayPlane { impl DisplayPlane { /// See the docs of enumerate(). - pub fn enumerate_raw(device: &PhysicalDevice) -> Result, OomError> { + pub fn enumerate_raw(device: PhysicalDevice) -> Result, OomError> { let vk = device.instance().pointers(); assert!(device.instance().loaded_extensions().khr_display); // TODO: return error instead @@ -117,7 +117,7 @@ impl DisplayPlane { /// // TODO: move iterator creation here from raw constructor? #[inline] - pub fn enumerate(device: &PhysicalDevice) -> IntoIter { + pub fn enumerate(device: PhysicalDevice) -> IntoIter { DisplayPlane::enumerate_raw(device).unwrap() } @@ -159,7 +159,7 @@ pub struct Display { impl Display { /// See the docs of enumerate(). - pub fn enumerate_raw(device: &PhysicalDevice) -> Result, OomError> { + pub fn enumerate_raw(device: PhysicalDevice) -> Result, OomError> { let vk = device.instance().pointers(); assert!(device.instance().loaded_extensions().khr_display); // TODO: return error instead @@ -202,7 +202,7 @@ impl Display { /// // TODO: move iterator creation here from raw constructor? #[inline] - pub fn enumerate(device: &PhysicalDevice) -> IntoIter { + pub fn enumerate(device: PhysicalDevice) -> IntoIter { Display::enumerate_raw(device).unwrap() } diff --git a/vulkano/src/tests.rs b/vulkano/src/tests.rs index 997a4572..7dedc89f 100644 --- a/vulkano/src/tests.rs +++ b/vulkano/src/tests.rs @@ -55,7 +55,7 @@ macro_rules! gfx_dev_and_queue { return; } - let (device, mut queues) = match Device::new(&physical, &features, + let (device, mut queues) = match Device::new(physical, &features, &extensions, [(queue, 0.5)].iter().cloned()) { Ok(r) => r,