rename vertex_buffer to instanceable

This commit is contained in:
Carter Anderson 2020-03-16 12:15:51 -07:00
parent 0ba48ed83a
commit 62d1e710a5
3 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ struct UniformAttributeArgs {
#[darling(default)] #[darling(default)]
pub shader_def: Option<bool>, pub shader_def: Option<bool>,
#[darling(default)] #[darling(default)]
pub vertex_buffer: Option<bool>, pub instanceable: Option<bool>,
} }
#[proc_macro_derive(Uniforms, attributes(uniform))] #[proc_macro_derive(Uniforms, attributes(uniform))]
@ -139,10 +139,10 @@ pub fn derive_uniforms(input: TokenStream) -> TokenStream {
texture_and_sampler_name_strings.push(sampler.clone()); texture_and_sampler_name_strings.push(sampler.clone());
texture_and_sampler_name_idents.push(f.ident.clone()); texture_and_sampler_name_idents.push(f.ident.clone());
texture_and_sampler_name_idents.push(f.ident.clone()); texture_and_sampler_name_idents.push(f.ident.clone());
let is_vertex_buffer_member = match attrs { let is_instanceable = match attrs {
Some(attrs) => { Some(attrs) => {
match attrs.vertex_buffer { match attrs.instanceable {
Some(vertex_buffer) => vertex_buffer, Some(instanceable) => instanceable,
None => false, None => false,
} }
}, },
@ -153,7 +153,7 @@ pub fn derive_uniforms(input: TokenStream) -> TokenStream {
uniform_name: #uniform, uniform_name: #uniform,
texture_name: #texture, texture_name: #texture,
sampler_name: #sampler, sampler_name: #sampler,
is_vertex_buffer_member: #is_vertex_buffer_member, is_instanceable: #is_instanceable,
}) })
}); });

View File

@ -110,7 +110,7 @@ pub struct FieldInfo {
pub uniform_name: &'static str, pub uniform_name: &'static str,
pub texture_name: &'static str, pub texture_name: &'static str,
pub sampler_name: &'static str, pub sampler_name: &'static str,
pub is_vertex_buffer_member: bool, pub is_instanceable: bool,
} }
pub trait AsFieldBindType { pub trait AsFieldBindType {

View File

@ -13,7 +13,7 @@ const LOCAL_TO_WORLD_FIELD_INFOS: &[FieldInfo] = &[FieldInfo {
uniform_name: "Object", uniform_name: "Object",
texture_name: "", texture_name: "",
sampler_name: "", sampler_name: "",
is_vertex_buffer_member: false, is_instanceable: false,
}]; }];
impl AsUniforms for bevy_transform::prelude::LocalToWorld { impl AsUniforms for bevy_transform::prelude::LocalToWorld {