Skip to content

Commit 405ceaa

Browse files
committed
some renaming & cleanup
1 parent 851998c commit 405ceaa

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

crates/bevy_render/src/mesh/mesh.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ fn update_entity_mesh(
453453
for render_pipeline in render_pipelines.pipelines.iter_mut() {
454454
render_pipeline.specialization.primitive_topology = mesh.primitive_topology;
455455
// TODO: don't allocate a new vertex buffer descriptor for every entity
456-
render_pipeline.specialization.vertex_buffer_descriptor = mesh.get_vertex_buffer_layout();
456+
render_pipeline.specialization.vertex_buffer_layout = mesh.get_vertex_buffer_layout();
457457
if let PrimitiveTopology::LineStrip | PrimitiveTopology::TriangleStrip =
458458
mesh.primitive_topology
459459
{

crates/bevy_render/src/pipeline/pipeline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::{
22
state_descriptors::{
3-
BlendFactor, BlendOperation, ColorWrite, CompareFunction, CullMode, FrontFace, IndexFormat,
3+
BlendFactor, BlendOperation, ColorWrite, CompareFunction, CullMode, FrontFace,
44
PrimitiveTopology,
55
},
66
PipelineLayout,

crates/bevy_render/src/pipeline/pipeline_compiler.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct PipelineSpecialization {
1616
pub primitive_topology: PrimitiveTopology,
1717
pub dynamic_bindings: HashSet<String>,
1818
pub strip_index_format: Option<IndexFormat>,
19-
pub vertex_buffer_descriptor: VertexBufferLayout,
19+
pub vertex_buffer_layout: VertexBufferLayout,
2020
pub sample_count: u32,
2121
}
2222

@@ -28,7 +28,7 @@ impl Default for PipelineSpecialization {
2828
shader_specialization: Default::default(),
2929
primitive_topology: Default::default(),
3030
dynamic_bindings: Default::default(),
31-
vertex_buffer_descriptor: Default::default(),
31+
vertex_buffer_layout: Default::default(),
3232
}
3333
}
3434
}
@@ -198,12 +198,12 @@ impl PipelineCompiler {
198198
// create a vertex layout that provides all attributes from either the specialized vertex buffers or a zero buffer
199199
let mut pipeline_layout = specialized_descriptor.layout.as_mut().unwrap();
200200
// the vertex buffer descriptor of the mesh
201-
let mesh_vertex_buffer_descriptor = &pipeline_specialization.vertex_buffer_descriptor;
201+
let mesh_vertex_buffer_layout = &pipeline_specialization.vertex_buffer_layout;
202202

203203
// the vertex buffer descriptor that will be used for this pipeline
204204
let mut compiled_vertex_buffer_descriptor = VertexBufferLayout {
205205
step_mode: InputStepMode::Vertex,
206-
stride: mesh_vertex_buffer_descriptor.stride,
206+
stride: mesh_vertex_buffer_layout.stride,
207207
..Default::default()
208208
};
209209

@@ -213,7 +213,7 @@ impl PipelineCompiler {
213213
.get(0)
214214
.expect("Reflected layout has no attributes.");
215215

216-
if let Some(target_vertex_attribute) = mesh_vertex_buffer_descriptor
216+
if let Some(target_vertex_attribute) = mesh_vertex_buffer_layout
217217
.attributes
218218
.iter()
219219
.find(|x| x.name == shader_vertex_attribute.name)

crates/bevy_render/src/pipeline/pipeline_layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl PipelineLayout {
4949
}
5050
}
5151

52-
for vertex_buffer_descriptor in shader_layouts[0].vertex_buffer_layouts.iter() {
52+
for vertex_buffer_descriptor in shader_layouts[0].vertex_buffer_layout.iter() {
5353
vertex_buffer_descriptors.push(vertex_buffer_descriptor.clone());
5454
}
5555

crates/bevy_render/src/shader/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::pipeline::{BindGroupDescriptor, VertexBufferLayout};
1717
#[derive(Debug, Clone, PartialEq, Eq)]
1818
pub struct ShaderLayout {
1919
pub bind_groups: Vec<BindGroupDescriptor>,
20-
pub vertex_buffer_layouts: Vec<VertexBufferLayout>,
20+
pub vertex_buffer_layout: Vec<VertexBufferLayout>,
2121
pub entry_point: String,
2222
}
2323

crates/bevy_render/src/shader/shader_reflect.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl ShaderLayout {
4949

5050
vertex_attributes.sort_by(|a, b| a.shader_location.cmp(&b.shader_location));
5151

52-
let mut vertex_buffer_layouts = Vec::new();
52+
let mut vertex_buffer_layout = Vec::new();
5353
for vertex_attribute in vertex_attributes.drain(..) {
5454
let mut instance = false;
5555
// obtain buffer name and instancing flag
@@ -67,7 +67,7 @@ impl ShaderLayout {
6767
};
6868

6969
// create a new buffer descriptor, per attribute!
70-
vertex_buffer_layouts.push(VertexBufferLayout {
70+
vertex_buffer_layout.push(VertexBufferLayout {
7171
attributes: vec![vertex_attribute],
7272
name: current_buffer_name.into(),
7373
step_mode: if instance {
@@ -81,7 +81,7 @@ impl ShaderLayout {
8181

8282
ShaderLayout {
8383
bind_groups,
84-
vertex_buffer_layouts,
84+
vertex_buffer_layout,
8585
entry_point: entry_point_name,
8686
}
8787
}
@@ -130,7 +130,7 @@ fn reflect_binding(
130130
&binding.name,
131131
BindType::Texture {
132132
view_dimension: reflect_dimension(type_description),
133-
sample_type: TextureSampleType::Float { filterable: false },
133+
sample_type: TextureSampleType::Float { filterable: true },
134134
multisampled: false,
135135
},
136136
),

crates/bevy_wgpu/src/wgpu_renderer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl WgpuRenderer {
3737
.request_adapter(&wgpu::RequestAdapterOptions {
3838
power_preference: match options.power_pref {
3939
WgpuPowerOptions::HighPerformance => wgpu::PowerPreference::HighPerformance,
40-
WgpuPowerOptions::Adaptive => Default::default(),
40+
WgpuPowerOptions::Adaptive => wgpu::PowerPreference::LowPower,
4141
WgpuPowerOptions::LowPower => wgpu::PowerPreference::LowPower,
4242
},
4343
compatible_surface: None,

0 commit comments

Comments
 (0)