X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogrambuilder.h;h=69170e02ef979f543b16f1fc53ef0c9adbc0c2d1;hb=d542522823423f9ed2a5d412de9250ee8367334b;hp=7840ecf00a2ef993a3590b6dd802f798b3d5878e;hpb=103cebacd5572e770e4463163688802ee4f6efbf;p=libs%2Fgl.git diff --git a/source/programbuilder.h b/source/programbuilder.h index 7840ecf0..69170e02 100644 --- a/source/programbuilder.h +++ b/source/programbuilder.h @@ -54,6 +54,15 @@ private: FRAGMENT }; + enum InterfaceFlags + { + NO_INTERFACE = 0, + INPUT = 1, + OUTPUT = 2, + PASSTHROUGH = INPUT|OUTPUT, + GOAL = 4 + }; + struct VariableDefinition { VariableScope scope; @@ -82,9 +91,12 @@ private: void resolve_space(const std::string &); void add_reference(ShaderVariable &); void update_reference(ShaderVariable &, ShaderVariable &); - void check_inline(bool); + void check_inline(bool, bool); bool is_referenced_from(VariableScope) const; - std::string get_expression() 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; }; enum MatchLevel @@ -100,6 +112,7 @@ private: bool optimize; static const VariableDefinition standard_variables[]; + static const char interfaces[]; public: ProgramBuilder(const StandardFeatures &);