From 0ac3af31ea290e09da7ca1d7014b5fa1a0680540 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Sat, 11 Nov 2023 14:17:50 -0800 Subject: [PATCH] Misc rename --- crates/bevy_pbr/src/meshlet/gpu_scene.rs | 12 ++++++------ crates/bevy_pbr/src/meshlet/material_draw_nodes.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/bevy_pbr/src/meshlet/gpu_scene.rs b/crates/bevy_pbr/src/meshlet/gpu_scene.rs index e976af8dbabde..459de2e80fa76 100644 --- a/crates/bevy_pbr/src/meshlet/gpu_scene.rs +++ b/crates/bevy_pbr/src/meshlet/gpu_scene.rs @@ -108,7 +108,7 @@ pub fn queue_material_meshlet_meshes( .get(&material_asset_id) .expect("TODO: Will this error ever occur?"); - gpu_scene.material_ids_used.insert(material_id); + gpu_scene.material_ids_present_in_scene.insert(material_id); gpu_scene.instance_material_ids.get_mut().push(material_id); } } @@ -315,7 +315,7 @@ pub struct MeshletGpuScene { scene_index_count: u64, next_material_id: u32, material_id_lookup: HashMap, - material_ids_used: HashSet, + material_ids_present_in_scene: HashSet, instances: Vec, instance_uniforms: StorageBuffer>, instance_material_ids: StorageBuffer>, @@ -347,7 +347,7 @@ impl FromWorld for MeshletGpuScene { scene_index_count: 0, next_material_id: 0, material_id_lookup: HashMap::new(), - material_ids_used: HashSet::new(), + material_ids_present_in_scene: HashSet::new(), instances: Vec::new(), instance_uniforms: { let mut buffer = StorageBuffer::default(); @@ -414,7 +414,7 @@ impl MeshletGpuScene { self.scene_index_count = 0; self.next_material_id = 0; self.material_id_lookup.clear(); - self.material_ids_used.clear(); + self.material_ids_present_in_scene.clear(); self.instances.clear(); self.instance_uniforms.get_mut().clear(); self.instance_material_ids.get_mut().clear(); @@ -483,8 +483,8 @@ impl MeshletGpuScene { }) } - pub fn material_used(&self, material_id: &u32) -> bool { - self.material_ids_used.contains(material_id) + pub fn material_present_in_scene(&self, material_id: &u32) -> bool { + self.material_ids_present_in_scene.contains(material_id) } pub fn culling_bind_group_layout(&self) -> BindGroupLayout { diff --git a/crates/bevy_pbr/src/meshlet/material_draw_nodes.rs b/crates/bevy_pbr/src/meshlet/material_draw_nodes.rs index 533b7622f071e..c5246fef04a1f 100644 --- a/crates/bevy_pbr/src/meshlet/material_draw_nodes.rs +++ b/crates/bevy_pbr/src/meshlet/material_draw_nodes.rs @@ -108,7 +108,7 @@ impl ViewNode for MeshletMainOpaquePass3dNode { for (material_id, material_pipeline_id, material_bind_group) in &meshlet_view_materials.opaque_pass { - if gpu_scene.material_used(material_id) { + if gpu_scene.material_present_in_scene(material_id) { if let Some(material_pipeline) = pipeline_cache.get_render_pipeline(*material_pipeline_id) {