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 virtual void visit(Block &);
65 bool check_version(const Version &) const;
66 bool check_extension(bool Features::*) const;
67 bool supports_stage(Stage::Type) const;
68 bool supports_unified_interface_syntax() const;
69 virtual void visit(VariableReference &);
70 virtual void visit(Assignment &);
71 bool supports_unified_sampling_functions() const;
72 virtual void visit(FunctionCall &);
73 bool supports_interface_layouts() const;
74 bool supports_centroid_sampling() const;
75 bool supports_sample_sampling() const;
76 virtual void visit(VariableDeclaration &);
77 bool supports_interface_blocks(const std::string &) const;
78 virtual void visit(InterfaceBlock &);