diff options
author | Greg Fischer <greg@lunarg.com> | 2021-09-15 21:38:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 21:38:34 +0300 |
commit | 4ac8e5e541ea992dc6f44a4d4eb065a8fe0888ec (patch) | |
tree | ce9ce81607f8b739820727cc3accf7a7a7c4f271 /include | |
parent | 9e65f054d1a13f64c2f1e4fa7b55791e35fbea6e (diff) |
Add preserve_interface mode to aggressive_dead_code_elim (#4520)
This mode is needed by GPU-assisted validation instrumentation which
cannot change the shader entry point interface.
Diffstat (limited to 'include')
-rw-r--r-- | include/spirv-tools/optimizer.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp index 8141ec865..42eb6442e 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -29,7 +29,7 @@ namespace spvtools { namespace opt { class Pass; struct DescriptorSetAndBinding; -} +} // namespace opt // C++ interface for SPIR-V optimization functionalities. It wraps the context // (including target environment and the corresponding SPIR-V grammar) and @@ -514,7 +514,12 @@ Optimizer::PassToken CreateDeadInsertElimPass(); // Conversion, which tends to cause cycles of dead code to be left after // Store/Load elimination passes are completed. These cycles cannot be // eliminated with standard dead code elimination. -Optimizer::PassToken CreateAggressiveDCEPass(); +// +// If |preserve_interface| is true, all non-io variables in the entry point +// interface are considered live and are not eliminated. This mode is needed +// by GPU-Assisted validation instrumentation, where a change in the interface +// is not allowed. +Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface = false); // Creates a remove-unused-interface-variables pass. // Removes variables referenced on the |OpEntryPoint| instruction that are not |