mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
add rustfmt.toml and set merge_imports to true
This commit is contained in:
parent
4f4213be11
commit
76d5f6057c
23 changed files with 69 additions and 65 deletions
|
@ -1,5 +1,7 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy::render::render_graph_2::{ShaderUniforms, StandardMaterial};
|
||||
use bevy::{
|
||||
prelude::*,
|
||||
render::render_graph_2::{ShaderUniforms, StandardMaterial},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
AppBuilder::new().add_defaults().setup_world(setup).run();
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy::render::render_graph_2::{uniform_selector, ShaderUniforms, StandardMaterial};
|
||||
use bevy::{
|
||||
prelude::*,
|
||||
render::render_graph_2::{uniform_selector, ShaderUniforms, StandardMaterial},
|
||||
};
|
||||
use rand::{rngs::StdRng, Rng, SeedableRng};
|
||||
use std::collections::VecDeque;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy::render::render_graph_2::{ShaderUniforms, StandardMaterial};
|
||||
use bevy::{
|
||||
prelude::*,
|
||||
render::render_graph_2::{ShaderUniforms, StandardMaterial},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
AppBuilder::new().add_defaults().setup_world(setup).run();
|
||||
|
|
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
|
@ -0,0 +1 @@
|
|||
merge_imports = true
|
|
@ -4,12 +4,15 @@ use crate::{
|
|||
core::Time,
|
||||
legion::prelude::{Runnable, Schedulable, Schedule, Universe, World},
|
||||
plugin::load_plugin,
|
||||
render::render_graph_2,
|
||||
render::render_graph_2::{
|
||||
passes::*, pipelines::*, renderers::wgpu_renderer::WgpuRenderer, resource_providers::*,
|
||||
StandardMaterial,
|
||||
render::{
|
||||
passes::*,
|
||||
render_graph_2,
|
||||
render_graph_2::{
|
||||
passes::*, pipelines::*, renderers::wgpu_renderer::WgpuRenderer, resource_providers::*,
|
||||
StandardMaterial,
|
||||
},
|
||||
*,
|
||||
},
|
||||
render::{passes::*, *},
|
||||
ui,
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use std::boxed::Box;
|
||||
use std::error::Error;
|
||||
use std::{fs, io};
|
||||
use std::{boxed::Box, error::Error, fs, io};
|
||||
|
||||
// use crate::render::Mesh;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use crate::prelude::*;
|
||||
use crate::render::render_graph_2::{ShaderUniforms, StandardMaterial};
|
||||
use crate::{
|
||||
prelude::*,
|
||||
render::render_graph_2::{ShaderUniforms, StandardMaterial},
|
||||
};
|
||||
use bevy_derive::EntityArchetype;
|
||||
|
||||
#[derive(EntityArchetype)]
|
||||
|
|
|
@ -3,8 +3,7 @@ pub use crate::{
|
|||
asset::{Asset, AssetStorage, Handle, Mesh, MeshType, Texture, TextureType},
|
||||
core::Time,
|
||||
ecs,
|
||||
ecs::default_archetypes::*,
|
||||
ecs::{EntityArchetype, EntityBuilder, EntityBuilderSource},
|
||||
ecs::{default_archetypes::*, EntityArchetype, EntityBuilder, EntityBuilderSource},
|
||||
render::{
|
||||
ActiveCamera, ActiveCamera2d, Albedo, Camera, CameraType, Instanced, Light, Material,
|
||||
},
|
||||
|
@ -15,7 +14,6 @@ pub use glam as math;
|
|||
pub use legion::{
|
||||
prelude::*,
|
||||
schedule::{Builder, Schedulable},
|
||||
system::SubWorld,
|
||||
system::SystemBuilder,
|
||||
system::{SubWorld, SystemBuilder},
|
||||
};
|
||||
pub use math::{Mat3, Mat4, Quat, Vec2, Vec3, Vec4};
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
use crate::{asset::*, render::passes::shadow, render::*};
|
||||
use crate::{
|
||||
asset::*,
|
||||
render::{passes::shadow, *},
|
||||
};
|
||||
use legion::prelude::*;
|
||||
use wgpu::SwapChainOutput;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use crate::{
|
||||
prelude::{LocalToWorld, Translation},
|
||||
render::passes::shadow,
|
||||
render::*,
|
||||
render::{passes::shadow, *},
|
||||
};
|
||||
use legion::prelude::*;
|
||||
use std::mem;
|
||||
|
|
|
@ -56,4 +56,4 @@ pub fn mesh_draw_target(world: &World, render_pass: &mut dyn RenderPass) {
|
|||
let renderer = render_pass.get_renderer();
|
||||
renderer.remove_buffer(resource_name::buffer::TEMP_MESH_VERTEX_BUFFER_NAME);
|
||||
renderer.remove_buffer(resource_name::buffer::TEMP_MESH_INDEX_BUFFER_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
mod ui_draw_target;
|
||||
mod mesh_draw_target;
|
||||
mod ui_draw_target;
|
||||
|
||||
pub use ui_draw_target::*;
|
||||
pub use mesh_draw_target::*;
|
||||
pub use ui_draw_target::*;
|
||||
|
|
|
@ -24,4 +24,4 @@ pub use renderer::*;
|
|||
pub use resource::*;
|
||||
pub use resource_provider::*;
|
||||
pub use standard_material::*;
|
||||
pub use uniform::*;
|
||||
pub use uniform::*;
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
use crate::render::{
|
||||
Vertex,
|
||||
{
|
||||
render_graph_2::{
|
||||
draw_targets::mesh_draw_target, pipeline_layout::*, PipelineDescriptor,
|
||||
RenderGraphBuilder,
|
||||
},
|
||||
shader::{Shader, ShaderStage},
|
||||
render_graph_2::{
|
||||
draw_targets::mesh_draw_target, pipeline_layout::*, PipelineDescriptor, RenderGraphBuilder,
|
||||
},
|
||||
shader::{Shader, ShaderStage},
|
||||
Vertex,
|
||||
};
|
||||
pub trait ForwardFlatPipelineBuilder {
|
||||
fn add_forward_flat_pipeline(self) -> Self;
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
use crate::render::render_graph_2::resource_providers::RectData;
|
||||
use crate::render::render_graph_2::VertexBufferDescriptor;
|
||||
use crate::render::{
|
||||
Vertex,
|
||||
{
|
||||
render_graph_2::{
|
||||
draw_targets::ui_draw_target, pipeline_layout::*, PipelineDescriptor,
|
||||
RenderGraphBuilder,
|
||||
},
|
||||
shader::{Shader, ShaderStage},
|
||||
render_graph_2::{
|
||||
draw_targets::ui_draw_target, pipeline_layout::*, resource_providers::RectData,
|
||||
PipelineDescriptor, RenderGraphBuilder, VertexBufferDescriptor,
|
||||
},
|
||||
shader::{Shader, ShaderStage},
|
||||
Vertex,
|
||||
};
|
||||
pub trait UiPipelineBuilder {
|
||||
fn add_ui_pipeline(self) -> Self;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use crate::render::render_graph_2::ResourceProvider;
|
||||
use crate::render::{
|
||||
render_graph_2::{resource_name, Renderer},
|
||||
render_graph_2::{resource_name, Renderer, ResourceProvider},
|
||||
ActiveCamera2d, Camera,
|
||||
};
|
||||
use legion::prelude::*;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use crate::render::render_graph_2::ResourceProvider;
|
||||
use crate::render::{
|
||||
render_graph_2::{resource_name, Renderer},
|
||||
render_graph_2::{resource_name, Renderer, ResourceProvider},
|
||||
ActiveCamera, Camera,
|
||||
};
|
||||
use bevy_transform::prelude::LocalToWorld;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::prelude::World;
|
||||
use crate::render::render_graph_2::Renderer;
|
||||
use crate::render::render_graph_2::ResourceProvider;
|
||||
use crate::render::render_graph_2::TextureDescriptor;
|
||||
use crate::{
|
||||
prelude::World,
|
||||
render::render_graph_2::{Renderer, ResourceProvider, TextureDescriptor},
|
||||
};
|
||||
|
||||
pub struct FrameTextureResourceProvider {
|
||||
pub name: String,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::render::render_graph_2::resource_name;
|
||||
use crate::render::render_graph_2::Renderer;
|
||||
use crate::render::render_graph_2::ResourceProvider;
|
||||
use crate::render::{Light, LightRaw};
|
||||
use crate::render::{
|
||||
render_graph_2::{resource_name, Renderer, ResourceProvider},
|
||||
Light, LightRaw,
|
||||
};
|
||||
use bevy_transform::prelude::{LocalToWorld, Translation};
|
||||
use legion::prelude::*;
|
||||
use zerocopy::AsBytes;
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
use crate::asset::MeshType;
|
||||
use crate::prelude::Node;
|
||||
use crate::render::render_graph_2::resource_name;
|
||||
use crate::render::render_graph_2::ResourceProvider;
|
||||
use crate::{
|
||||
asset::{Asset, AssetStorage, Handle, Mesh},
|
||||
asset::{Asset, AssetStorage, Handle, Mesh, MeshType},
|
||||
ecs, math,
|
||||
render::render_graph_2::Renderer,
|
||||
prelude::Node,
|
||||
render::render_graph_2::{resource_name, Renderer, ResourceProvider},
|
||||
};
|
||||
use bevy_transform::prelude::Parent;
|
||||
use legion::prelude::*;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
use crate::{
|
||||
math::Vec4,
|
||||
render::render_graph_2::{BindType, UniformPropertyType, uniform::{UniformInfo, AsUniforms, GetBytes}},
|
||||
render::render_graph_2::{
|
||||
uniform::{AsUniforms, GetBytes, UniformInfo},
|
||||
BindType, UniformPropertyType,
|
||||
},
|
||||
};
|
||||
|
||||
use zerocopy::AsBytes;
|
||||
|
@ -9,7 +12,6 @@ pub struct StandardMaterial {
|
|||
pub albedo: Vec4,
|
||||
}
|
||||
|
||||
|
||||
// create this from a derive macro
|
||||
const STANDARD_MATERIAL_UNIFORM_INFO: &[UniformInfo] = &[UniformInfo {
|
||||
name: "StandardMaterial",
|
||||
|
|
|
@ -129,4 +129,4 @@ impl ShaderUniforms {
|
|||
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
use crate::{math, prelude::LocalToWorld, render::passes::ForwardUniforms, render::*};
|
||||
use crate::{
|
||||
math,
|
||||
prelude::LocalToWorld,
|
||||
render::{passes::ForwardUniforms, *},
|
||||
};
|
||||
|
||||
use legion::prelude::*;
|
||||
use std::mem;
|
||||
|
|
Loading…
Reference in a new issue