File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,12 @@ class ConvertUBOToPushConstantPass : public spvtools::opt::Pass
246246 context ()->UpdateDefUse (target_var);
247247 modified = true ;
248248
249+ // IMPORTANT: We changed pointer types + storage class; TypeManager and other analyses may be stale.
250+ // Invalidate analyses that can cache type information and def-use.
251+ context ()->InvalidateAnalyses (spvtools::opt::IRContext::kAnalysisTypes |
252+ spvtools::opt::IRContext::kAnalysisDefUse |
253+ spvtools::opt::IRContext::kAnalysisDecorations );
254+
249255 // Propagate storage class change to all users of this variable
250256 std::vector<spvtools::opt::Instruction*> users;
251257 get_def_use_mgr ()->ForEachUser (target_var, [&users](spvtools::opt::Instruction* user) {
@@ -271,6 +277,9 @@ class ConvertUBOToPushConstantPass : public spvtools::opt::Pass
271277 decoration == spv::Decoration::DescriptorSet;
272278 });
273279
280+ // Invalidate decoration analysis since we modified decorations
281+ context ()->InvalidateAnalyses (spvtools::opt::IRContext::kAnalysisDecorations );
282+
274283 return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
275284 }
276285
You can’t perform that action at this time.
0 commit comments