Skip to content

Commit bd3e7b6

Browse files
authored
[naga] Consolidate entry point tracing code. (#6917)
1 parent c71d670 commit bd3e7b6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

naga/src/compact/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ pub fn compact(module: &mut crate::Module) {
7373
}
7474
}
7575

76-
for e in module.entry_points.iter() {
77-
if let Some(sizes) = e.workgroup_size_overrides {
78-
for size in sizes.iter().filter_map(|x| *x) {
79-
module_tracer.global_expressions_used.insert(size);
80-
}
81-
}
82-
}
83-
8476
// We assume that all functions are used.
8577
//
8678
// Observe which types, constant expressions, constants, and
@@ -106,6 +98,13 @@ pub fn compact(module: &mut crate::Module) {
10698
.iter()
10799
.map(|e| {
108100
log::trace!("tracing entry point {:?}", e.function.name);
101+
102+
if let Some(sizes) = e.workgroup_size_overrides {
103+
for size in sizes.iter().filter_map(|x| *x) {
104+
module_tracer.global_expressions_used.insert(size);
105+
}
106+
}
107+
109108
let mut used = module_tracer.as_function(&e.function);
110109
used.trace();
111110
FunctionMap::from(used)

0 commit comments

Comments
 (0)