From c1bac8869eb176b3449b613db1e6e3091a269a57 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sun, 9 Feb 2020 18:09:54 -0800 Subject: [PATCH] move uniforms around --- src/app/app_builder.rs | 1 - src/render/render_graph_2/mod.rs | 4 ++-- .../local_to_world.rs} | 11 ++--------- src/render/render_graph_2/uniforms/mod.rs | 5 +++++ .../render_graph_2/uniforms/standard_material.rs | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 12 deletions(-) rename src/render/render_graph_2/{standard_material.rs => uniforms/local_to_world.rs} (87%) create mode 100644 src/render/render_graph_2/uniforms/mod.rs create mode 100644 src/render/render_graph_2/uniforms/standard_material.rs diff --git a/src/app/app_builder.rs b/src/app/app_builder.rs index 5f46149ee4..c9b38c43d0 100644 --- a/src/app/app_builder.rs +++ b/src/app/app_builder.rs @@ -6,7 +6,6 @@ use crate::{ plugin::load_plugin, render::{ passes::*, - render_graph_2, render_graph_2::{ passes::*, pipelines::*, renderers::wgpu_renderer::WgpuRenderer, resource_providers::*, StandardMaterial, diff --git a/src/render/render_graph_2/mod.rs b/src/render/render_graph_2/mod.rs index 5a4b5b0f1b..458410bacc 100644 --- a/src/render/render_graph_2/mod.rs +++ b/src/render/render_graph_2/mod.rs @@ -12,7 +12,7 @@ mod resource; pub mod resource_name; pub mod resource_provider; pub mod resource_providers; -mod standard_material; +mod uniforms; mod uniform; mod renderable; @@ -24,6 +24,6 @@ pub use render_graph::*; pub use renderer::*; pub use resource::*; pub use resource_provider::*; -pub use standard_material::*; +pub use uniforms::*; pub use uniform::*; pub use renderable::*; diff --git a/src/render/render_graph_2/standard_material.rs b/src/render/render_graph_2/uniforms/local_to_world.rs similarity index 87% rename from src/render/render_graph_2/standard_material.rs rename to src/render/render_graph_2/uniforms/local_to_world.rs index 4c6d8de093..1afde9e208 100644 --- a/src/render/render_graph_2/standard_material.rs +++ b/src/render/render_graph_2/uniforms/local_to_world.rs @@ -1,19 +1,12 @@ use crate::{ - math::Vec4, render::render_graph_2::{ - uniform::{AsUniforms, GetBytes, UniformInfo}, + uniform::{AsUniforms, UniformInfo}, BindType, UniformPropertyType, }, }; -use bevy_derive::Uniforms; use zerocopy::AsBytes; -#[derive(Uniforms)] -pub struct StandardMaterial { - pub albedo: Vec4, -} - const LOCAL_TO_WORLD_UNIFORM_INFO: &[UniformInfo] = &[UniformInfo { name: "Object", bind_type: BindType::Uniform { @@ -47,4 +40,4 @@ impl AsUniforms for bevy_transform::prelude::LocalToWorld { _ => None, } } -} +} \ No newline at end of file diff --git a/src/render/render_graph_2/uniforms/mod.rs b/src/render/render_graph_2/uniforms/mod.rs new file mode 100644 index 0000000000..bbcff5d859 --- /dev/null +++ b/src/render/render_graph_2/uniforms/mod.rs @@ -0,0 +1,5 @@ +mod standard_material; +mod local_to_world; + +pub use standard_material::*; +pub use local_to_world::*; \ No newline at end of file diff --git a/src/render/render_graph_2/uniforms/standard_material.rs b/src/render/render_graph_2/uniforms/standard_material.rs new file mode 100644 index 0000000000..106d23de91 --- /dev/null +++ b/src/render/render_graph_2/uniforms/standard_material.rs @@ -0,0 +1,14 @@ +use crate::{ + math::Vec4, + render::render_graph_2::{ + uniform::{AsUniforms, GetBytes, UniformInfo}, + BindType, UniformPropertyType, + }, +}; + +use bevy_derive::Uniforms; + +#[derive(Uniforms)] +pub struct StandardMaterial { + pub albedo: Vec4, +} \ No newline at end of file