Skip to content

Commit

Permalink
Misc rename
Browse files Browse the repository at this point in the history
  • Loading branch information
JMS55 committed Nov 11, 2023
1 parent f360662 commit 0ac3af3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions crates/bevy_pbr/src/meshlet/gpu_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub fn queue_material_meshlet_meshes<M: Material>(
.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);
}
}
Expand Down Expand Up @@ -315,7 +315,7 @@ pub struct MeshletGpuScene {
scene_index_count: u64,
next_material_id: u32,
material_id_lookup: HashMap<UntypedAssetId, u32>,
material_ids_used: HashSet<u32>,
material_ids_present_in_scene: HashSet<u32>,
instances: Vec<Entity>,
instance_uniforms: StorageBuffer<Vec<MeshUniform>>,
instance_material_ids: StorageBuffer<Vec<u32>>,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/meshlet/material_draw_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 0ac3af3

Please sign in to comment.