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
This commit is contained in:
@@ -265,3 +265,27 @@ ir_print_visitor::visit(ir_return *ir)
|
||||
|
||||
printf(")");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_if *ir)
|
||||
{
|
||||
printf("(if ");
|
||||
ir->condition->accept(this);
|
||||
|
||||
printf("(\n");
|
||||
foreach_iter(exec_list_iterator, iter, ir->then_instructions) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
inst->accept(this);
|
||||
}
|
||||
printf(")\n");
|
||||
|
||||
printf("(\n");
|
||||
foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
inst->accept(this);
|
||||
}
|
||||
printf("))\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user