1 #ifndef MSP_GL_SL_COMPATIBILITY_H_
2 #define MSP_GL_SL_COMPATIBILITY_H_
11 /** Generates default precision declarations if they are missing, to satisfy
12 GLSL ES requirements. */
13 class DefaultPrecisionGenerator: private TraversingVisitor
17 std::set<std::string> have_default;
18 NodeList<Statement>::iterator insert_point;
21 DefaultPrecisionGenerator();
26 virtual void visit(Block &);
27 virtual void visit(Precision &);
28 virtual void visit(VariableDeclaration &);
31 /** Removes precision qualifiers from variable declarations, as well as
32 default precision declarations. */
33 class PrecisionRemover: private TraversingVisitor
36 std::set<Node *> nodes_to_remove;
42 virtual void visit(Precision &);
43 virtual void visit(VariableDeclaration &);
46 /** Converts structures of the syntax tree to match a particular set of
48 class LegacyConverter: private TraversingVisitor
54 VariableDeclaration *frag_out;
55 NodeList<Statement>::iterator uniform_insert_point;
56 std::set<Node *> nodes_to_remove;
61 virtual void apply(Stage &, const Features &);
64 void unsupported(const std::string &);
66 virtual void visit(Block &);
67 bool check_version(const Version &) const;
68 bool check_extension(bool Features::*) const;
69 bool supports_stage(Stage::Type) const;
70 bool supports_unified_interface_syntax() const;
71 virtual void visit(VariableReference &);
72 virtual void visit(Assignment &);
73 bool supports_unified_sampling_functions() const;
74 virtual void visit(FunctionCall &);
75 bool supports_interface_layouts() const;
76 bool supports_centroid_sampling() const;
77 bool supports_sample_sampling() const;
78 virtual void visit(VariableDeclaration &);
79 bool supports_interface_blocks(const std::string &) const;
80 virtual void visit(InterfaceBlock &);