From 3c6fea3048a0d9add2fec621d30c32f3519d8868 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 29 Mar 2010 14:11:25 -0700 Subject: Implement ir_if (for if-statments) and conversion from AST The following tests now pass: glslparsertest/shaders/if1.frag glslparsertest/shaders/if2.frag The following tests that used to pass now fail. It appears that most of these fail because ast_nequal and ast_equal are not converted to HIR. shaders/glsl-unused-varying.frag shaders/glsl-fs-sqrt-branch.frag --- ir.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ir.h') diff --git a/ir.h b/ir.h index 328cd4e4ff..83e4f95b0c 100644 --- a/ir.h +++ b/ir.h @@ -192,6 +192,28 @@ public: /*@}*/ +/** + * IR instruction representing high-level if-statements + */ +class ir_if : public ir_instruction { +public: + ir_if(ir_rvalue *condition) + : condition(condition) + { + /* empty */ + } + + virtual void accept(ir_visitor *v) + { + v->visit(this); + } + + ir_rvalue *condition; + exec_list then_instructions; + exec_list else_instructions; +}; + + class ir_assignment : public ir_rvalue { public: ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition); -- cgit v1.2.3