diff --git a/crates/bevy_render/src/mesh/mesh.rs b/crates/bevy_render/src/mesh/mesh.rs index dca18d0213544..edb309ece04dd 100644 --- a/crates/bevy_render/src/mesh/mesh.rs +++ b/crates/bevy_render/src/mesh/mesh.rs @@ -453,7 +453,7 @@ fn update_entity_mesh( for render_pipeline in render_pipelines.pipelines.iter_mut() { render_pipeline.specialization.primitive_topology = mesh.primitive_topology; // TODO: don't allocate a new vertex buffer descriptor for every entity - render_pipeline.specialization.vertex_buffer_descriptor = mesh.get_vertex_buffer_layout(); + render_pipeline.specialization.vertex_buffer_layout = mesh.get_vertex_buffer_layout(); if let PrimitiveTopology::LineStrip | PrimitiveTopology::TriangleStrip = mesh.primitive_topology { diff --git a/crates/bevy_render/src/pipeline/pipeline.rs b/crates/bevy_render/src/pipeline/pipeline.rs index 83bb40920adf2..27a8570d888b5 100644 --- a/crates/bevy_render/src/pipeline/pipeline.rs +++ b/crates/bevy_render/src/pipeline/pipeline.rs @@ -1,6 +1,6 @@ use super::{ state_descriptors::{ - BlendFactor, BlendOperation, ColorWrite, CompareFunction, CullMode, FrontFace, IndexFormat, + BlendFactor, BlendOperation, ColorWrite, CompareFunction, CullMode, FrontFace, PrimitiveTopology, }, PipelineLayout, diff --git a/crates/bevy_render/src/pipeline/pipeline_compiler.rs b/crates/bevy_render/src/pipeline/pipeline_compiler.rs index 040272e7454dc..1831b97bd3994 100644 --- a/crates/bevy_render/src/pipeline/pipeline_compiler.rs +++ b/crates/bevy_render/src/pipeline/pipeline_compiler.rs @@ -16,7 +16,7 @@ pub struct PipelineSpecialization { pub primitive_topology: PrimitiveTopology, pub dynamic_bindings: HashSet, pub strip_index_format: Option, - pub vertex_buffer_descriptor: VertexBufferLayout, + pub vertex_buffer_layout: VertexBufferLayout, pub sample_count: u32, } @@ -28,7 +28,7 @@ impl Default for PipelineSpecialization { shader_specialization: Default::default(), primitive_topology: Default::default(), dynamic_bindings: Default::default(), - vertex_buffer_descriptor: Default::default(), + vertex_buffer_layout: Default::default(), } } } @@ -198,12 +198,12 @@ impl PipelineCompiler { // create a vertex layout that provides all attributes from either the specialized vertex buffers or a zero buffer let mut pipeline_layout = specialized_descriptor.layout.as_mut().unwrap(); // the vertex buffer descriptor of the mesh - let mesh_vertex_buffer_descriptor = &pipeline_specialization.vertex_buffer_descriptor; + let mesh_vertex_buffer_layout = &pipeline_specialization.vertex_buffer_layout; // the vertex buffer descriptor that will be used for this pipeline let mut compiled_vertex_buffer_descriptor = VertexBufferLayout { step_mode: InputStepMode::Vertex, - stride: mesh_vertex_buffer_descriptor.stride, + stride: mesh_vertex_buffer_layout.stride, ..Default::default() }; @@ -213,7 +213,7 @@ impl PipelineCompiler { .get(0) .expect("Reflected layout has no attributes."); - if let Some(target_vertex_attribute) = mesh_vertex_buffer_descriptor + if let Some(target_vertex_attribute) = mesh_vertex_buffer_layout .attributes .iter() .find(|x| x.name == shader_vertex_attribute.name) diff --git a/crates/bevy_render/src/pipeline/pipeline_layout.rs b/crates/bevy_render/src/pipeline/pipeline_layout.rs index 9ce74bb2d4a31..86702f4dadd8c 100644 --- a/crates/bevy_render/src/pipeline/pipeline_layout.rs +++ b/crates/bevy_render/src/pipeline/pipeline_layout.rs @@ -49,7 +49,7 @@ impl PipelineLayout { } } - for vertex_buffer_descriptor in shader_layouts[0].vertex_buffer_layouts.iter() { + for vertex_buffer_descriptor in shader_layouts[0].vertex_buffer_layout.iter() { vertex_buffer_descriptors.push(vertex_buffer_descriptor.clone()); } diff --git a/crates/bevy_render/src/shader/mod.rs b/crates/bevy_render/src/shader/mod.rs index f5aa0d1acd5f6..dee5179b79342 100644 --- a/crates/bevy_render/src/shader/mod.rs +++ b/crates/bevy_render/src/shader/mod.rs @@ -17,7 +17,7 @@ use crate::pipeline::{BindGroupDescriptor, VertexBufferLayout}; #[derive(Debug, Clone, PartialEq, Eq)] pub struct ShaderLayout { pub bind_groups: Vec, - pub vertex_buffer_layouts: Vec, + pub vertex_buffer_layout: Vec, pub entry_point: String, } diff --git a/crates/bevy_render/src/shader/shader_reflect.rs b/crates/bevy_render/src/shader/shader_reflect.rs index 71c398972b34b..db0397ca99df2 100644 --- a/crates/bevy_render/src/shader/shader_reflect.rs +++ b/crates/bevy_render/src/shader/shader_reflect.rs @@ -49,7 +49,7 @@ impl ShaderLayout { vertex_attributes.sort_by(|a, b| a.shader_location.cmp(&b.shader_location)); - let mut vertex_buffer_layouts = Vec::new(); + let mut vertex_buffer_layout = Vec::new(); for vertex_attribute in vertex_attributes.drain(..) { let mut instance = false; // obtain buffer name and instancing flag @@ -67,7 +67,7 @@ impl ShaderLayout { }; // create a new buffer descriptor, per attribute! - vertex_buffer_layouts.push(VertexBufferLayout { + vertex_buffer_layout.push(VertexBufferLayout { attributes: vec![vertex_attribute], name: current_buffer_name.into(), step_mode: if instance { @@ -81,7 +81,7 @@ impl ShaderLayout { ShaderLayout { bind_groups, - vertex_buffer_layouts, + vertex_buffer_layout, entry_point: entry_point_name, } } @@ -130,7 +130,7 @@ fn reflect_binding( &binding.name, BindType::Texture { view_dimension: reflect_dimension(type_description), - sample_type: TextureSampleType::Float { filterable: false }, + sample_type: TextureSampleType::Float { filterable: true }, multisampled: false, }, ), diff --git a/crates/bevy_text/src/draw.rs b/crates/bevy_text/src/draw.rs index 54120dc356ba3..3a00d7bda02ad 100644 --- a/crates/bevy_text/src/draw.rs +++ b/crates/bevy_text/src/draw.rs @@ -29,7 +29,7 @@ impl<'a> Drawable for DrawableText<'a> { &bevy_sprite::SPRITE_SHEET_PIPELINE_HANDLE.typed(), &PipelineSpecialization { sample_count: self.msaa.samples, - vertex_buffer_descriptor: self.font_quad_vertex_layout.clone(), + vertex_buffer_layout: self.font_quad_vertex_layout.clone(), ..Default::default() }, )?; diff --git a/crates/bevy_wgpu/src/wgpu_renderer.rs b/crates/bevy_wgpu/src/wgpu_renderer.rs index 23af09cb43f22..9bb800c6e3cce 100644 --- a/crates/bevy_wgpu/src/wgpu_renderer.rs +++ b/crates/bevy_wgpu/src/wgpu_renderer.rs @@ -37,7 +37,7 @@ impl WgpuRenderer { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: match options.power_pref { WgpuPowerOptions::HighPerformance => wgpu::PowerPreference::HighPerformance, - WgpuPowerOptions::Adaptive => Default::default(), + WgpuPowerOptions::Adaptive => wgpu::PowerPreference::LowPower, WgpuPowerOptions::LowPower => wgpu::PowerPreference::LowPower, }, compatible_surface: None,