Add fix storage class code. (#2434)
This pass tries to fix validation error due to a mismatch of storage classes
in instructions. There is no guarantee that all such error will be fixed,
and it is possible that in fixing these errors, it could lead to other
errors.
Fixes #2430.
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index 4e92bb0..846ad70 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -753,6 +753,11 @@
// variables to the first value stored in them, if that is a constant.
Optimizer::PassToken CreateGenerateWebGPUInitializersPass();
+// Create a pass to fix incorrect storage classes. In order to make code
+// generation simpler, DXC may generate code where the storage classes do not
+// match up correctly. This pass will fix the errors that it can.
+Optimizer::PassToken CreateFixStorageClassPass();
+
} // namespace spvtools
#endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_