1 #ifndef MSP_GL_SL_COMPATIBILITY_H_
2 #define MSP_GL_SL_COMPATIBILITY_H_
11 class LocationAllocator: private TraversingVisitor
14 std::map<std::string, std::set<unsigned> > used_locations;
15 std::map<std::string, unsigned> uniform_locations;
16 std::vector<VariableDeclaration *> unplaced_variables;
23 void allocate_locations(const std::string &);
24 void add_location(RefPtr<Layout> &, unsigned);
26 virtual void visit(VariableDeclaration &);
27 virtual void visit(InterfaceBlock &) { }
28 virtual void visit(FunctionDeclaration &) { }
31 /** Generates default precision declarations or removes precision declarations
32 according to the requirements of the target API. */
33 class PrecisionConverter: private TraversingVisitor
37 std::set<std::string> have_default;
38 NodeList<Statement>::iterator insert_point;
39 std::set<Node *> nodes_to_remove;
47 virtual void visit(Block &);
48 virtual void visit(Precision &);
49 virtual void visit(VariableDeclaration &);
52 /** Converts structures of the syntax tree to match a particular set of
54 class LegacyConverter: private TraversingVisitor
59 VariableDeclaration *frag_out;
60 NodeList<Statement>::iterator uniform_insert_point;
61 std::set<Node *> nodes_to_remove;
66 virtual void apply(Stage &, const Features &);
69 void unsupported(const std::string &);
71 virtual void visit(Block &);
72 bool check_version(const Version &) const;
73 bool check_extension(bool Features::*) const;
74 bool supports_stage(Stage::Type) const;
75 bool supports_unified_interface_syntax() const;
76 virtual void visit(VariableReference &);
77 virtual void visit(Assignment &);
78 bool supports_unified_sampling_functions() const;
79 virtual void visit(FunctionCall &);
80 bool supports_interface_layouts() const;
81 bool supports_stage_interface_layouts() const;
82 bool supports_centroid_sampling() const;
83 bool supports_sample_sampling() const;
84 bool supports_uniform_location() const;
85 virtual void visit(VariableDeclaration &);
86 bool supports_interface_blocks(const std::string &) const;
87 bool supports_interface_block_location() const;
88 virtual void visit(InterfaceBlock &);