mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
add shader_def to albedo ColorSource and auto import trait in macro
This commit is contained in:
parent
b809b22589
commit
a1b9e3a7a5
2 changed files with 2 additions and 0 deletions
|
@ -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<Vec<String>> {
|
||||
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()),)*
|
||||
];
|
||||
|
|
|
@ -5,6 +5,7 @@ use bevy_derive::Uniforms;
|
|||
|
||||
#[derive(Uniforms)]
|
||||
pub struct StandardMaterial {
|
||||
#[uniform(shader_def)]
|
||||
pub albedo: ColorSource,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue