From f1b0d04e53ba3683344fb372c36875d38fb0b9c5 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 19 Aug 2020 10:00:45 -0400 Subject: [PATCH] Fixed formatting. --- .../bevy_render/src/pipeline/pipeline_layout.rs | 2 +- crates/bevy_render/src/shader/shader_reflect.rs | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/crates/bevy_render/src/pipeline/pipeline_layout.rs b/crates/bevy_render/src/pipeline/pipeline_layout.rs index 6a108471cd..52600348ba 100644 --- a/crates/bevy_render/src/pipeline/pipeline_layout.rs +++ b/crates/bevy_render/src/pipeline/pipeline_layout.rs @@ -47,7 +47,7 @@ impl PipelineLayout { } } } - + for vertex_buffer_descriptor in shader_layouts[0].vertex_buffer_descriptors.iter() { vertex_buffer_descriptors.push(vertex_buffer_descriptor.clone()); } diff --git a/crates/bevy_render/src/shader/shader_reflect.rs b/crates/bevy_render/src/shader/shader_reflect.rs index 9221f36e1f..d41cf64a72 100644 --- a/crates/bevy_render/src/shader/shader_reflect.rs +++ b/crates/bevy_render/src/shader/shader_reflect.rs @@ -9,7 +9,8 @@ use bevy_core::AsBytes; use spirv_reflect::{ types::{ ReflectDescriptorBinding, ReflectDescriptorSet, ReflectDescriptorType, ReflectDimension, - ReflectInterfaceVariable, ReflectTypeDescription, ReflectTypeFlags, ReflectShaderStageFlags + ReflectInterfaceVariable, ReflectShaderStageFlags, ReflectTypeDescription, + ReflectTypeFlags, }, ShaderModule, }; @@ -151,7 +152,10 @@ fn reflect_vertex_attribute_descriptor( } } -fn reflect_bind_group(descriptor_set: &ReflectDescriptorSet, shader_stage: ReflectShaderStageFlags) -> BindGroupDescriptor { +fn reflect_bind_group( + descriptor_set: &ReflectDescriptorSet, + shader_stage: ReflectShaderStageFlags, +) -> BindGroupDescriptor { let mut bindings = Vec::new(); for descriptor_binding in descriptor_set.bindings.iter() { let binding = reflect_binding(descriptor_binding, shader_stage); @@ -171,7 +175,10 @@ fn reflect_dimension(type_description: &ReflectTypeDescription) -> TextureViewDi } } -fn reflect_binding(binding: &ReflectDescriptorBinding, shader_stage: ReflectShaderStageFlags) -> BindingDescriptor { +fn reflect_binding( + binding: &ReflectDescriptorBinding, + shader_stage: ReflectShaderStageFlags, +) -> BindingDescriptor { let type_description = binding.type_description.as_ref().unwrap(); let (name, bind_type) = match binding.descriptor_type { ReflectDescriptorType::UniformBuffer => ( @@ -205,7 +212,7 @@ fn reflect_binding(binding: &ReflectDescriptorBinding, shader_stage: ReflectShad ReflectShaderStageFlags::COMPUTE => BindingShaderStage::COMPUTE, ReflectShaderStageFlags::VERTEX => BindingShaderStage::VERTEX, ReflectShaderStageFlags::FRAGMENT => BindingShaderStage::FRAGMENT, - _ => panic!("Only one specified shader stage is supported.") + _ => panic!("Only one specified shader stage is supported."), }; let name = name.to_string();