]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/debug.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / glsl / debug.h
index 73976904aee60d09b5b5c51cb3980e7dac90c692..b3682e7b30a98915ff219aaf09a03113beacc9c3 100644 (file)
@@ -32,12 +32,30 @@ private:
                Branch(Node *n): node(n) { }
        };
 
+       struct Colors
+       {
+               const char *default_color;
+               const char *tree_color;
+               const char *location_color;
+               const char *label_color;
+               const char *type_color;
+               const char *name_color;
+               const char *error_color;
+       };
+
        std::map<const Node *, unsigned> node_labels;
        std::string formatted;
        std::vector<TreeChars> tree;
+       const Colors &colors;
+
+       static const Colors no_colors;
+       static const Colors default_colors;
 
 public:
-       const std::string &apply(Stage &);
+       DumpTree(bool = false);
+
+       std::string apply(Stage &);
+       std::string apply(Node &n) { n.visit(*this); return formatted; }
 
 private:
        void append(const std::string &);
@@ -47,8 +65,10 @@ private:
        void begin_sub();
        void last_branch();
        void end_sub();
-       unsigned get_label(const Node &);
+       std::string get_label(const Node &);
        std::string format_type(TypeDeclaration *);
+       std::string format_type(const std::string &);
+       std::string format_name(const std::string &);
 
        template<typename T>
        typename T::const_iterator increment(typename T::const_iterator &, const T &);
@@ -56,7 +76,6 @@ private:
        virtual void visit(Block &);
        virtual void visit(Literal &);
        virtual void visit(VariableReference &);
-       virtual void visit(InterfaceBlockReference &);
        virtual void visit(MemberAccess &);
        virtual void visit(Swizzle &);
        virtual void visit(UnaryExpression &);
@@ -73,7 +92,6 @@ private:
        virtual void visit(ImageTypeDeclaration &);
        virtual void visit(StructDeclaration &);
        virtual void visit(VariableDeclaration &);
-       virtual void visit(InterfaceBlock &);
        virtual void visit(FunctionDeclaration &);
        virtual void visit(Conditional &);
        virtual void visit(Iteration &);