summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-08-05 19:12:16 -0700
committerEric Anholt <[email protected]>2011-08-16 13:04:41 -0700
commit164ccd27787e0df4ae6f85a7178aff0720d56ac9 (patch)
tree82fcd16a27adc48e9c6f3a7338e4e5f4f1b161fc /src/mesa
parentaa753c5a14637ede804e8043762693122174bf8c (diff)
i965/vs: Fix support for "IF" instructions by copying brw_fs_visitor.cpp.
Fixes glsl-vs-if-greater.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index c3b55db4ac1..014f7e62284 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -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);