cargo fmt main crate
This commit is contained in:
parent
96f7d10e36
commit
e6cdb5ebe8
|
@ -226,7 +226,7 @@ impl Flycam {
|
|||
pub fn get_camera(&self) -> Camera {
|
||||
Camera {
|
||||
eye: self.get_eye(),
|
||||
vp: self.get_vp()
|
||||
vp: self.get_vp(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use super::*;
|
||||
use crate::scene::{DebugIndex as Index, DebugVertex as Vertex, DebugDrawList};
|
||||
use crate::scene::{DebugDrawList, DebugIndex as Index, DebugVertex as Vertex};
|
||||
use crate::storage::GpuVec;
|
||||
use crate::viewport::ViewportInfo;
|
||||
use crate::RenderLayouts;
|
||||
|
|
|
@ -49,7 +49,7 @@ pub struct Attributes {
|
|||
|
||||
impl Attributes {
|
||||
pub fn new(attr_store: impl AsRef<AttrStore>) -> Self {
|
||||
Self {
|
||||
Self {
|
||||
vertex: attr_store.as_ref().get_type::<Vertex>(),
|
||||
index: attr_store.as_ref().add(AttrInfo {
|
||||
layout: AttrLayout {
|
||||
|
@ -57,7 +57,7 @@ impl Attributes {
|
|||
},
|
||||
usages: wgpu::BufferUsages::INDEX,
|
||||
default_pool_size: 1_000_000,
|
||||
})
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ impl MeshPass {
|
|||
&self.mesh_pool
|
||||
}
|
||||
|
||||
pub fn get_attributes(&self) -> &Attributes{
|
||||
pub fn get_attributes(&self) -> &Attributes {
|
||||
&self.attributes
|
||||
}
|
||||
|
||||
|
@ -322,11 +322,9 @@ impl RenderPass for MeshPass {
|
|||
let mut transformed_meshes_lock = self.transformed_meshes.write();
|
||||
let mesh_bindings = self
|
||||
.mesh_pool
|
||||
.iter_meshes(
|
||||
self.mesh_layout_id,
|
||||
transformed_meshes_lock.iter(),
|
||||
|i| &i.mesh,
|
||||
)
|
||||
.iter_meshes(self.mesh_layout_id, transformed_meshes_lock.iter(), |i| {
|
||||
&i.mesh
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
let mut skinned_cursor = 0;
|
||||
|
@ -384,8 +382,16 @@ impl RenderPass for MeshPass {
|
|||
};
|
||||
|
||||
for (mesh, infos) in instances {
|
||||
let vertices = infos.iter().find(|i| i.0 == self.attributes.vertex).unwrap().1;
|
||||
let indices = infos.iter().find(|i| i.0 == self.attributes.index).unwrap().1;
|
||||
let vertices = infos
|
||||
.iter()
|
||||
.find(|i| i.0 == self.attributes.vertex)
|
||||
.unwrap()
|
||||
.1;
|
||||
let indices = infos
|
||||
.iter()
|
||||
.find(|i| i.0 == self.attributes.index)
|
||||
.unwrap()
|
||||
.1;
|
||||
|
||||
group.meshes.push(MeshCommand {
|
||||
vertex_offset: vertices.offset,
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
//! TODO: use wgpu::util::StagingBelt?
|
||||
//! TODO: pass access to a wgpu::Queue for write_buffer, staging belt recall, or command encoding
|
||||
|
||||
use parking_lot::Mutex;
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::Arc;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
pub struct StagingPool<T> {
|
||||
device: Arc<wgpu::Device>,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::staging::*;
|
||||
use parking_lot::{RwLock, RwLockReadGuard};
|
||||
use slab::Slab;
|
||||
use smallvec::SmallVec;
|
||||
use std::any::TypeId;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use parking_lot::{RwLock, RwLockReadGuard};
|
||||
|
||||
/// An error that can be returned when allocating a mesh.
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -92,9 +92,11 @@ impl WinitViewport {
|
|||
pub fn acquire(&mut self) -> Result<(), wgpu::SurfaceError> {
|
||||
if self.output_view.is_none() {
|
||||
let surface_texture = self.surface.get_current_texture()?;
|
||||
self.output_view = Some(surface_texture
|
||||
.texture
|
||||
.create_view(&wgpu::TextureViewDescriptor::default()));
|
||||
self.output_view = Some(
|
||||
surface_texture
|
||||
.texture
|
||||
.create_view(&wgpu::TextureViewDescriptor::default()),
|
||||
);
|
||||
self.surface_texture = Some(surface_texture);
|
||||
}
|
||||
|
||||
|
@ -156,9 +158,9 @@ impl Viewport for WinitViewport {
|
|||
|
||||
fn get_views(&self) -> ViewportViews {
|
||||
let output = self.output_view.as_ref().unwrap();
|
||||
ViewportViews {
|
||||
ViewportViews {
|
||||
output,
|
||||
depth: &self.depth_texture_view
|
||||
depth: &self.depth_texture_view,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue