aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2018-01-30 11:24:03 -0500
committerSteven Perron <stevenperron@google.com>2018-02-01 15:25:09 -0500
commit61d8c0384b8400e5a88febb457611d22e36a76c8 (patch)
tree938e83b01e53e591c9d67d3acddb66db368d55ef /include
parentd37869c8424582f84c0d4f38708751307ec1d67f (diff)
downloadspirv-tools-61d8c0384b8400e5a88febb457611d22e36a76c8.tar.gz
Add pass to reaplce invalid opcodes
Creates a pass that will remove instructions that are invalid for the current shader stage. For the instruction to be considered for replacement 1) The opcode must be valid for a shader modules. 2) The opcode must be invalid for the current shader stage. 3) All entry points to the module must be for the same shader stage. 4) The function containing the instruction must be reachable from an entry point. Fixes #1247.
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/optimizer.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index a8d8da0c..b866bc69 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -500,6 +500,10 @@ Optimizer::PassToken CreateWorkaround1209Pass();
// Creates a pass that converts if-then-else like assignments into OpSelect.
Optimizer::PassToken CreateIfConversionPass();
+// Creates a pass that will replace instructions that are not valid for the
+// current shader stage by constants. Has no effect on non-shader modules.
+Optimizer::PassToken CreateReplaceInvalidOpcodePass();
+
} // namespace spvtools
#endif // SPIRV_TOOLS_OPTIMIZER_HPP_