commit | bfe04e3d263a77e68afef77e9d63f0d03f68cd59 | [log] [tgz] |
---|---|---|
author | John Stiles <johnstiles@google.com> | Fri Jul 29 18:36:45 2022 -0400 |
committer | John Stiles <johnstiles@google.com> | Fri Jul 29 22:38:16 2022 +0000 |
tree | 0e99a504ae8af0bacf4982e4b134c226c8d88ad4 | |
parent | c5fb1f796056d9d6f7f72328d92f915fc6ca678d [diff] |
Rewrite FindAndDeclareBuiltinVariables to rely on ProgramUsage. Rather than scan every expression in the program to look for built-in variables, we can check the existing scan from ProgramUsage to quickly find every built-in variable and add a declaration for it. Previously, we got free determinism because the declarations were created in program order--we added them as we found them during a ProgramVisitor run. Now, to avoid nondeterminism, we must enforce a consistent but arbitrary order. For interface blocks, we order based on the name of the block. For global variables, we order them based on the name of the variable. Change-Id: I65f74cf52df9552a47e119d4153b42feced36c48 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/563123 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com>