]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programsyntax.h
Refactor module and stage management
[libs/gl.git] / source / programsyntax.h
index c8b0e1f74ed9d1679e8c652ddb1f52f896872df5..c645a60a442ec91a616060f11c55327e9a34d4f6 100644 (file)
@@ -301,32 +301,29 @@ struct TraversingVisitor: NodeVisitor
        virtual void visit(Return &);
 };
 
-enum ContextType
+enum StageType
 {
-       GLOBAL,
+       SHARED,
        VERTEX,
        GEOMETRY,
        FRAGMENT
 };
 
-struct Context
+struct Stage
 {
-       ContextType type;
-       bool present;
-       Context *previous;
+       StageType type;
+       Stage *previous;
        ProgramSyntax::Block content;
        std::map<std::string, VariableDeclaration *> in_variables;
        std::map<std::string, VariableDeclaration *> out_variables;
 
-       Context(ContextType);
+       Stage(StageType);
 };
 
 struct Module
 {
-       Context global_context;
-       Context vertex_context;
-       Context geometry_context;
-       Context fragment_context;
+       Stage shared;
+       std::list<Stage> stages;
 
        Module();
 };