]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/debug.cpp
Implement the ternary operator in GLSL
[libs/gl.git] / source / glsl / debug.cpp
index 68615ed6e06d67c7491a2e88ce10bce360b1685d..700acbf9cd50a66c8db4e98c54343d8696a332ce 100644 (file)
@@ -240,6 +240,17 @@ void DumpTree::visit(Assignment &assign)
        end_sub();
 }
 
+void DumpTree::visit(TernaryExpression &ternary)
+{
+       append(format("Ternary: %s -> %s", (ternary.oper->token[0]=='?' ? "?:" : ternary.oper->token), format_type(ternary.type)));
+       begin_sub();
+       ternary.condition->visit(*this);
+       ternary.true_expr->visit(*this);
+       last_branch();
+       ternary.false_expr->visit(*this);
+       end_sub();
+}
+
 void DumpTree::visit(FunctionCall &call)
 {
        string head = "Function call: ";