]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Track source names in SL::Module
[libs/gl.git] / source / glsl / syntax.h
index 549e5e895add03fb41f8b62b3c038a1be01326cb..7764712498bb3106666f3e8bee98de72881516df 100644 (file)
@@ -7,6 +7,7 @@
 #include <vector>
 #include <msp/core/refptr.h>
 #include "extension.h"
+#include "sourcemap.h"
 #include "uniform.h"
 
 #pragma push_macro("interface")
@@ -360,17 +361,17 @@ struct Jump: Statement
        virtual void visit(NodeVisitor &);
 };
 
-enum StageType
-{
-       SHARED,
-       VERTEX,
-       GEOMETRY,
-       FRAGMENT
-};
-
 struct Stage
 {
-       StageType type;
+       enum Type
+       {
+               SHARED,
+               VERTEX,
+               GEOMETRY,
+               FRAGMENT
+       };
+
+       Type type;
        Stage *previous;
        Block content;
        std::map<std::string, VariableDeclaration *> in_variables;
@@ -379,11 +380,14 @@ struct Stage
        Version required_version;
        std::vector<const Extension *> required_extensions;
 
-       Stage(StageType);
+       Stage(Type);
+
+       static const char *get_stage_name(Type);
 };
 
 struct Module
 {
+       SourceMap source_map;
        Stage shared;
        std::list<Stage> stages;