]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.h
Further refactor the resolving process in SL::Compiler
[libs/gl.git] / source / glsl / compiler.h
index 9891293af303e5552c1d970977f7ac528c4af6a7..6448ae6cfa6fe962dc5097ffcf2011f835ebbaf9 100644 (file)
@@ -28,6 +28,16 @@ private:
                REDO_PREVIOUS
        };
 
+       enum ResolveFlags
+       {
+               RESOLVE_BLOCKS = 1,
+               RESOLVE_TYPES = 2,
+               RESOLVE_VARIABLES = 4,
+               RESOLVE_EXPRESSIONS = 8,
+               RESOLVE_FUNCTIONS = 16,
+               RESOLVE_ALL = 31
+       };
+
        Features features;
        Module *module;
        std::vector<std::string> imported_names;
@@ -113,8 +123,13 @@ private:
        variables. */
        void generate(Stage &, Mode);
 
-       /** Resolves references and expression types. */
-       void resolve(Stage &);
+       template<typename T>
+       bool resolve(Stage &, unsigned &, unsigned);
+
+       /** Resolves various references between nodes.  Flags can be specified to
+       request resolving particular aspects.  Resolving may ripple into other
+       aspects as necessary. */
+       void resolve(Stage &, unsigned = RESOLVE_ALL);
 
        bool validate(Stage &);