diff --git a/bevy_derive/src/lib.rs b/bevy_derive/src/lib.rs index fe3204f344..34b62ef7b4 100644 --- a/bevy_derive/src/lib.rs +++ b/bevy_derive/src/lib.rs @@ -159,6 +159,7 @@ pub fn derive_uniforms(input: TokenStream) -> TokenStream { // TODO: this will be very allocation heavy. find a way to either make this allocation free // or alternatively only run it when the shader_defs have changed fn get_shader_defs(&self) -> Option> { + use bevy::render::render_graph::ShaderDefSuffixProvider; let mut potential_shader_defs: Vec<(&'static str, Option<&'static str>)> = vec![ #((#shader_def_field_name_strs, self.#shader_def_field_names.get_shader_def()),)* ]; diff --git a/src/render/render_graph/uniforms/standard_material.rs b/src/render/render_graph/uniforms/standard_material.rs index d7492a9c36..67d9f45135 100644 --- a/src/render/render_graph/uniforms/standard_material.rs +++ b/src/render/render_graph/uniforms/standard_material.rs @@ -5,6 +5,7 @@ use bevy_derive::Uniforms; #[derive(Uniforms)] pub struct StandardMaterial { + #[uniform(shader_def)] pub albedo: ColorSource, }