X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompatibility.h;h=212007131e80a3d0e37173364005d68f3b8d1166;hb=e3ebc204edbcce7b66dcf4c6e34f46a0c44b20f8;hp=852a6590bd67c287cf272d1a85bc9cfdb746a5c3;hpb=5c33b56c3b97ca0381ac216a603c7553f4bea499;p=libs%2Fgl.git diff --git a/source/glsl/compatibility.h b/source/glsl/compatibility.h index 852a6590..21200713 100644 --- a/source/glsl/compatibility.h +++ b/source/glsl/compatibility.h @@ -8,6 +8,8 @@ namespace Msp { namespace GL { namespace SL { +/** Generates default precision declarations if they are missing, to satisfy +GLSL ES requirements. */ class DefaultPrecisionGenerator: private TraversingVisitor { private: @@ -26,6 +28,8 @@ private: virtual void visit(VariableDeclaration &); }; +/** Removes precision qualifiers from variable declarations, as well as +default precision declarations. */ class PrecisionRemover: private TraversingVisitor { private: @@ -39,12 +43,14 @@ private: virtual void visit(VariableDeclaration &); }; +/** Converts structures of the syntax tree to match a particular set of +features. */ class LegacyConverter: private TraversingVisitor { private: Stage *stage; Features features; - std::string type; + std::string r_type; VariableDeclaration *frag_out; NodeList::iterator uniform_insert_point; std::set nodes_to_remove; @@ -55,6 +61,8 @@ public: virtual void apply(Stage &, const Features &); private: + void unsupported(const std::string &); + virtual void visit(Block &); bool check_version(const Version &) const; bool check_extension(bool Features::*) const;