diff --git a/bevy_derive/src/lib.rs b/bevy_derive/src/lib.rs index fc7c635557..74aaf030e0 100644 --- a/bevy_derive/src/lib.rs +++ b/bevy_derive/src/lib.rs @@ -151,10 +151,10 @@ pub fn derive_uniforms(input: TokenStream) -> TokenStream { let struct_name = &ast.ident; let struct_name_string = struct_name.to_string(); - let struct_name_screaming_snake = struct_name.to_string().to_screaming_snake_case(); - let field_infos_ident = format_ident!("{}_FIELD_INFO", struct_name_screaming_snake); + let struct_name_uppercase = struct_name.to_string().to_uppercase(); + let field_infos_ident = format_ident!("{}_FIELD_INFO", struct_name_uppercase); let vertex_buffer_descriptor_ident = - format_ident!("{}_VERTEX_BUFFER_DESCRIPTOR", struct_name_screaming_snake); + format_ident!("{}_VERTEX_BUFFER_DESCRIPTOR", struct_name_uppercase); let active_uniform_field_names = active_uniform_fields .iter() @@ -342,7 +342,7 @@ pub fn derive_uniforms(input: TokenStream) -> TokenStream { Some(potential_shader_defs.drain(..) .filter(|(f, shader_def)| shader_def.is_some()) - .map(|(f, shader_def)| format!("{}_{}{}", #struct_name_screaming_snake, f, shader_def.unwrap())) + .map(|(f, shader_def)| format!("{}_{}{}", #struct_name_uppercase, f, shader_def.unwrap())) .collect::>()) } diff --git a/examples/custom_shader.rs b/examples/custom_shader.rs index b7815857fc..ca9bd838b3 100644 --- a/examples/custom_shader.rs +++ b/examples/custom_shader.rs @@ -12,7 +12,7 @@ fn main() { .add_defaults() .setup_render_graph(|render_graph_builder| { render_graph_builder - .add_resource_provider(UniformResourceProvider::::new()) + .add_resource_provider(UniformResourceProvider::::new(true)) .add_pipeline_to_pass(resource_name::pass::MAIN, "MyMaterial", |builder| { builder .with_vertex_shader(Shader::from_glsl( @@ -45,13 +45,13 @@ fn main() { void main() { o_Target = color; - # ifdef MY_MATERIAL_ALWAYS_RED + # ifdef MYMATERIAL_ALWAYS_RED o_Target = vec4(0.8, 0.0, 0.0, 1.0); # endif } "#, )) - .with_standard_config(); + .with_default_config(); }); }) .setup_world(setup) diff --git a/src/render/pipeline/pipeline.rs b/src/render/pipeline/pipeline.rs index 5075301f4b..75e3499dc2 100644 --- a/src/render/pipeline/pipeline.rs +++ b/src/render/pipeline/pipeline.rs @@ -236,7 +236,7 @@ impl<'a> PipelineBuilder<'a> { self } - pub fn with_standard_config(&mut self) -> &mut Self { + pub fn with_default_config(&mut self) -> &mut Self { self.with_depth_stencil_state(DepthStencilStateDescriptor { format: TextureFormat::Depth32Float, depth_write_enabled: true, diff --git a/src/render/pipeline/pipelines/forward/forward.frag b/src/render/pipeline/pipelines/forward/forward.frag index 9028bfdef7..efcf4a844a 100644 --- a/src/render/pipeline/pipelines/forward/forward.frag +++ b/src/render/pipeline/pipelines/forward/forward.frag @@ -27,14 +27,14 @@ layout(set = 2, binding = 1) uniform StandardMaterial_albedo { vec4 Albedo; }; -# ifdef STANDARD_MATERIAL_ALBEDO_TEXTURE +# ifdef STANDARDMATERIAL_ALBEDO_TEXTURE layout(set = 3, binding = 1) uniform texture2D StandardMaterial_albedo_texture; layout(set = 3, binding = 2) uniform sampler StandardMaterial_albedo_texture_sampler; # endif void main() { vec4 albedo = Albedo; -# ifdef STANDARD_MATERIAL_ALBEDO_TEXTURE +# ifdef STANDARDMATERIAL_ALBEDO_TEXTURE albedo *= texture( sampler2D(StandardMaterial_albedo_texture, StandardMaterial_albedo_texture_sampler), v_Uv);