Browse Source

cargo fmt

master
Alison Watson 3 years ago
parent
commit
ebe28522b7
  1. 4
      source/hal/event.rs
  2. 7
      source/main.rs
  3. 23
      source/render/buffer.rs
  4. 2
      source/render/device.rs
  5. 2
      source/render/framebuffer.rs

4
source/hal/event.rs

@ -1,6 +1,4 @@
use sdl2_sys::{
SDL_Event, SDL_EventType, SDL_PollEvent,
};
use sdl2_sys::{SDL_Event, SDL_EventType, SDL_PollEvent};
pub struct EventIterator;

7
source/main.rs

@ -218,11 +218,8 @@ fn fallback_main(
let device = Device::create(instance, &phys_device, &qf_info)?;
let vertex_buffer = Buffer::create_vertex(
device.clone(),
&phys_device,
VERTICES,
)?;
let vertex_buffer =
Buffer::create_vertex(device.clone(), &phys_device, VERTICES)?;
let image_avail_s = Semaphore::create_all(device.clone(), concur_frames)?;
let render_fini_s = Semaphore::create_all(device.clone(), concur_frames)?;

23
source/render/buffer.rs

@ -1,5 +1,8 @@
use crate::render::{Device, PhysicalDevice, Vertex};
use ash::{version::{DeviceV1_0, InstanceV1_0}, vk};
use ash::{
version::{DeviceV1_0, InstanceV1_0},
vk,
};
use std::rc::Rc;
pub struct Buffer {
@ -53,9 +56,8 @@ impl Buffer {
let handle = unsafe { device.create_buffer(&create_info, None)? };
let memory_reqs = unsafe {
device.get_buffer_memory_requirements(handle)
};
let memory_reqs =
unsafe { device.get_buffer_memory_requirements(handle) };
let memory_props = unsafe {
device.instance.get_physical_device_memory_properties(**phys_device)
@ -122,14 +124,11 @@ impl std::fmt::Display for ErrBufferCreate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Vk(res) => res.fmt(f),
Self::NoMemoryType(filter_flags, filter_type) => {
write!(
f,
"No memory type matching {{ flags: {:?}, type: {} }}",
filter_flags,
filter_type,
)
}
Self::NoMemoryType(filter_flags, filter_type) => write!(
f,
"No memory type matching {{ flags: {:?}, type: {} }}",
filter_flags, filter_type,
),
}
}
}

2
source/render/device.rs

@ -99,7 +99,7 @@ impl Device {
impl PhysicalDevice {
pub fn get(
instance: Rc<Instance>,
conf: &Conf
conf: &Conf,
) -> Result<Rc<Self>, ErrPhysicalDeviceGet> {
let devs = unsafe { instance.enumerate_physical_devices()? };

2
source/render/framebuffer.rs

@ -46,7 +46,7 @@ impl Framebuffer {
device.clone(),
render_pass.clone(),
image_view.clone(),
extent
extent,
)
})
.collect()

Loading…
Cancel
Save