i965/vs: Fix support for "IF" instructions by copying brw_fs_visitor.cpp.

Fixes glsl-vs-if-greater.
This commit is contained in:
Eric Anholt 2011-08-05 19:12:16 -07:00
parent aa753c5a14
commit 164ccd2778
1 changed files with 10 additions and 4 deletions

View File

@ -1451,12 +1451,18 @@ vec4_visitor::visit(ir_discard *ir)
void
vec4_visitor::visit(ir_if *ir)
{
/* Don't point the annotation at the if statement, because then it plus
* the then and else blocks get printed.
*/
this->base_ir = ir->condition;
ir->condition->accept(this);
assert(this->result.file != BAD_FILE);
/* FINISHME: condcode */
emit(BRW_OPCODE_IF);
if (intel->gen == 6) {
emit_if_gen6(ir);
} else {
emit_bool_to_cond_code(ir->condition);
vec4_instruction *inst = emit(BRW_OPCODE_IF);
inst->predicate = BRW_PREDICATE_NORMAL;
}
visit_instructions(&ir->then_instructions);