Skip to content

Commit

Permalink
[naga] Consolidate entry point tracing code. (#6917)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy authored Jan 14, 2025
1 parent c71d670 commit bd3e7b6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions naga/src/compact/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ pub fn compact(module: &mut crate::Module) {
}
}

for e in module.entry_points.iter() {
if let Some(sizes) = e.workgroup_size_overrides {
for size in sizes.iter().filter_map(|x| *x) {
module_tracer.global_expressions_used.insert(size);
}
}
}

// We assume that all functions are used.
//
// Observe which types, constant expressions, constants, and
Expand All @@ -106,6 +98,13 @@ pub fn compact(module: &mut crate::Module) {
.iter()
.map(|e| {
log::trace!("tracing entry point {:?}", e.function.name);

if let Some(sizes) = e.workgroup_size_overrides {
for size in sizes.iter().filter_map(|x| *x) {
module_tracer.global_expressions_used.insert(size);
}
}

let mut used = module_tracer.as_function(&e.function);
used.trace();
FunctionMap::from(used)
Expand Down

0 comments on commit bd3e7b6

Please sign in to comment.