diff --git a/vulkano/src/instance.rs b/vulkano/src/instance.rs index 368cc15c..06b09140 100644 --- a/vulkano/src/instance.rs +++ b/vulkano/src/instance.rs @@ -170,7 +170,7 @@ impl Instance { // Enumerating all physical devices. let physical_devices: Vec = unsafe { - let mut num = mem::uninitialized(); + let mut num = 0; try!(check_errors(vk.EnumeratePhysicalDevices(instance, &mut num, ptr::null_mut()))); let mut devices = Vec::with_capacity(num as usize); @@ -192,7 +192,7 @@ impl Instance { }; let queue_families = unsafe { - let mut num = mem::uninitialized(); + let mut num = 0; vk.GetPhysicalDeviceQueueFamilyProperties(device, &mut num, ptr::null_mut()); let mut families = Vec::with_capacity(num as usize); @@ -343,7 +343,7 @@ impl From for InstanceCreationError { /// Queries the list of layers that are available when creating an instance. pub fn layers_list() -> Result, OomError> { unsafe { - let mut num = mem::uninitialized(); + let mut num = 0; try!(check_errors(VK_ENTRY.EnumerateInstanceLayerProperties(&mut num, ptr::null_mut()))); let mut layers: Vec = Vec::with_capacity(num as usize); diff --git a/vulkano/src/swapchain/mod.rs b/vulkano/src/swapchain/mod.rs index 97ecb679..02e2a7c7 100644 --- a/vulkano/src/swapchain/mod.rs +++ b/vulkano/src/swapchain/mod.rs @@ -72,7 +72,7 @@ impl DisplayPlane { let vk = device.instance().pointers(); let num = unsafe { - let mut num: u32 = mem::uninitialized(); + let mut num: u32 = 0; try!(check_errors(vk.GetPhysicalDeviceDisplayPlanePropertiesKHR(device.internal_object(), &mut num, ptr::null_mut()))); num @@ -90,7 +90,7 @@ impl DisplayPlane { Ok(planes.into_iter().enumerate().map(|(index, prop)| { let num = unsafe { - let mut num: u32 = mem::uninitialized(); + let mut num: u32 = 0; check_errors(vk.GetDisplayPlaneSupportedDisplaysKHR(device.internal_object(), index as u32, &mut num, ptr::null_mut())).unwrap(); // TODO: shouldn't unwrap num @@ -140,7 +140,7 @@ impl Display { let vk = device.instance().pointers(); let num = unsafe { - let mut num = mem::uninitialized(); + let mut num = 0; try!(check_errors(vk.GetPhysicalDeviceDisplayPropertiesKHR(device.internal_object(), &mut num, ptr::null_mut()))); num @@ -185,7 +185,7 @@ impl Display { let vk = self.device.instance().pointers(); let num = unsafe { - let mut num = mem::uninitialized(); + let mut num = 0; try!(check_errors(vk.GetDisplayModePropertiesKHR(self.device.internal_object(), self.properties.display, &mut num, ptr::null_mut()))); diff --git a/vulkano/src/swapchain/swapchain.rs b/vulkano/src/swapchain/swapchain.rs index 05be232c..29e0fe36 100644 --- a/vulkano/src/swapchain/swapchain.rs +++ b/vulkano/src/swapchain/swapchain.rs @@ -133,7 +133,7 @@ impl Swapchain { }); let images = unsafe { - let mut num = mem::uninitialized(); + let mut num = 0; try!(check_errors(vk.GetSwapchainImagesKHR(device.internal_object(), swapchain.swapchain, &mut num, ptr::null_mut())));