]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compatibility.h
Split SL::Compiler into several files
[libs/gl.git] / source / glsl / compatibility.h
diff --git a/source/glsl/compatibility.h b/source/glsl/compatibility.h
new file mode 100644 (file)
index 0000000..f337687
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef MSP_GL_SL_COMPATIBILITY_H_
+#define MSP_GL_SL_COMPATIBILITY_H_
+
+#include <string>
+#include "visitor.h"
+
+namespace Msp {
+namespace GL {
+namespace SL {
+
+class DefaultPrecisionGenerator: public BlockModifier
+{
+private:
+       bool toplevel;
+       std::set<std::string> have_default;
+
+public:
+       DefaultPrecisionGenerator();
+
+       using StageVisitor::visit;
+       virtual void visit(Block &);
+       virtual void visit(Precision &);
+       virtual void visit(VariableDeclaration &);
+};
+
+class PrecisionRemover: public BlockModifier
+{
+public:
+       using StageVisitor::visit;
+       virtual void visit(Precision &);
+       virtual void visit(VariableDeclaration &);
+};
+
+class LegacyConverter: public BlockModifier
+{
+private:
+       GLApi target_api;
+       Version target_version;
+       std::string type;
+       VariableDeclaration *frag_out;
+
+public:
+       LegacyConverter();
+       LegacyConverter(const Version &);
+
+private:
+       bool check_version(const Version &) const;
+       bool check_extension(const Extension &) const;
+       using StageVisitor::visit;
+       bool supports_unified_interface_syntax() const;
+       virtual void visit(VariableReference &);
+       virtual void visit(Assignment &);
+       bool supports_unified_sampling_functions() const;
+       virtual void visit(FunctionCall &);
+       bool supports_interface_layouts() const;
+       bool supports_centroid_sampling() const;
+       bool supports_sample_sampling() const;
+       virtual void visit(VariableDeclaration &);
+       bool supports_interface_blocks(const std::string &) const;
+       virtual void visit(InterfaceBlock &);
+};
+
+} // namespace SL
+} // namespace GL
+} // namespace Msp
+
+#endif