This commit is contained in:
Jasper Bekkers 2020-09-22 09:00:14 +02:00
parent 4140589ca7
commit 3eaa45cc52
No known key found for this signature in database
GPG Key ID: 2F16E81D61CAEF01

View File

@ -478,7 +478,7 @@ struct DefUseAnalyzer<'a> {
def_ids: HashMap<u32, usize>,
use_ids: HashMap<u32, Vec<usize>>,
use_result_type_ids: HashMap<u32, Vec<usize>>,
instructions: &'a mut [rspirv::dr::Instruction]
instructions: &'a mut [rspirv::dr::Instruction],
}
impl<'a> DefUseAnalyzer<'a> {
@ -526,7 +526,7 @@ impl<'a> DefUseAnalyzer<'a> {
def_ids,
use_ids,
use_result_type_ids,
instructions
instructions,
}
}
@ -540,7 +540,9 @@ impl<'a> DefUseAnalyzer<'a> {
}
fn for_each_use<F>(&mut self, id: u32, mut f: F)
where F: FnMut(&mut rspirv::dr::Instruction) {
where
F: FnMut(&mut rspirv::dr::Instruction),
{
// find by `result_type`
if let Some(use_result_type_id) = self.use_result_type_ids.get(&id) {
for inst_idx in use_result_type_id {