]> git.tdb.fi Git - libs/gl.git/commitdiff
Output the passthrough statement in both GLSL and debug modes
authorMikko Rasa <tdb@tdb.fi>
Mon, 22 Feb 2021 00:34:12 +0000 (02:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 22 Feb 2021 00:34:12 +0000 (02:34 +0200)
source/glsl/debug.cpp
source/glsl/debug.h
source/glsl/output.cpp
source/glsl/output.h

index 2bc3a893e099384e16c663cfdfd601e3a945d85d..4de8ac90ad927ed05175923827a25895ab176d71 100644 (file)
@@ -300,6 +300,18 @@ void DumpTree::visit(Iteration &iter)
        end_sub();
 }
 
+void DumpTree::visit(Passthrough &pass)
+{
+       append("passthrough");
+       if(pass.subscript)
+       {
+               begin_sub();
+               last_branch();
+               pass.subscript->visit(*this);
+               end_sub();
+       }
+}
+
 void DumpTree::visit(Return &ret)
 {
        if(ret.expression)
index 9806d545ccbdb6def3ddf3030c28d79926d54e80..5bc7a8bf884fbb09700b72490890e08ffc6b36ba 100644 (file)
@@ -58,6 +58,7 @@ private:
        virtual void visit(FunctionDeclaration &);
        virtual void visit(Conditional &);
        virtual void visit(Iteration &);
+       virtual void visit(Passthrough &);
        virtual void visit(Return &);
        virtual void visit(Jump &);
        using TraversingVisitor::visit;
index c1da9feccb2bd3f8e6c835bf91d57a21ad7b9913..46314588858667c059a80c131bb6f527b3ba9bc6 100644 (file)
@@ -341,6 +341,18 @@ void Formatter::visit(Iteration &iter)
        }
 }
 
+void Formatter::visit(Passthrough &pass)
+{
+       append("passthrough");
+       if(pass.subscript)
+       {
+               append('[');
+               pass.subscript->visit(*this);
+               append(']');
+       }
+       append(';');
+}
+
 void Formatter::visit(Return &ret)
 {
        append("return");
index aec63721d080c47ea6e28f5f1d2f0e4dedd8ff5b..e09f7c2ebca8c5dd18e094f89ed9a8939027007c 100644 (file)
@@ -52,6 +52,7 @@ private:
        virtual void visit(FunctionDeclaration &);
        virtual void visit(Conditional &);
        virtual void visit(Iteration &);
+       virtual void visit(Passthrough &);
        virtual void visit(Return &);
        virtual void visit(Jump &);
        using TraversingVisitor::visit;