]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programbuilder.h
Generalize shader interface handling
[libs/gl.git] / source / programbuilder.h
index 821907d5dba46a281323c3364e1b85095426296e..69170e02ef979f543b16f1fc53ef0c9adbc0c2d1 100644 (file)
@@ -54,6 +54,15 @@ private:
                FRAGMENT
        };
 
+       enum InterfaceFlags
+       {
+               NO_INTERFACE = 0,
+               INPUT = 1,
+               OUTPUT = 2,
+               PASSTHROUGH = INPUT|OUTPUT,
+               GOAL = 4
+       };
+
        struct VariableDefinition
        {
                VariableScope scope;
@@ -84,6 +93,7 @@ private:
                void update_reference(ShaderVariable &, ShaderVariable &);
                void check_inline(bool, bool);
                bool is_referenced_from(VariableScope) const;
+               InterfaceFlags get_interface_flags(VariableScope) const;
                std::string create_declaration(char = 0) const;
                std::string create_replacement(VariableScope) const;
                std::string create_expression() const;
@@ -102,6 +112,7 @@ private:
        bool optimize;
 
        static const VariableDefinition standard_variables[];
+       static const char interfaces[];
 
 public:
        ProgramBuilder(const StandardFeatures &);