Bläddra i källkod

cargo fmt

master
Alison Watson 1 år sedan
förälder
incheckning
ebe28522b7
5 ändrade filer med 16 tillägg och 22 borttagningar
  1. +1
    -3
      source/hal/event.rs
  2. +2
    -5
      source/main.rs
  3. +11
    -12
      source/render/buffer.rs
  4. +1
    -1
      source/render/device.rs
  5. +1
    -1
      source/render/framebuffer.rs

+ 1
- 3
source/hal/event.rs Visa fil

@@ -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;



+ 2
- 5
source/main.rs Visa fil

@@ -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)?;


+ 11
- 12
source/render/buffer.rs Visa fil

@@ -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,
),
}
}
}


+ 1
- 1
source/render/device.rs Visa fil

@@ -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()? };



+ 1
- 1
source/render/framebuffer.rs Visa fil

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


Laddar…
Avbryt
Spara