Closed mattfel1 closed 6 years ago
I made UseAnalyzer catch propogating uses if the blk of a node is an inner controller that itself contains other inner controllers (like a switch inside a foreach). This will probably over-substitute nodes that may or may not use extra resources after momery analysis is done, but it seems less hacky than going into the TransientCleanup and knowing to look up for the outermost-inner controller when we visit a switch inside an innerpipe to get the substitution rule correct. Waiting to see if regression is happy with this change
I added some code to the PropUses test to replicate this error
Actually, would it be better to run the FlatteningTransformer before the UseAnalyzer/TransientCleanup so that we don't even see these inner switches inside inner controllers?
Still trying to make a small test case that triggers this bug, but a snippet from Rendering3D is:
The problem seems to be the use of frag_z inside the if, since it has no substitution rule for the SimpleStruct when inside the inner switch