OLD | NEW |
(Empty) | |
| 1 From ead2ea89f42b40edc56ddf8c6ce1df4efdcefe2a Mon Sep 17 00:00:00 2001 |
| 2 From: Marek Olšák <maraeo@gmail.com> |
| 3 Date: Thu, 25 Nov 2010 11:13:36 +0000 |
| 4 Subject: ir_to_mesa: Add support for conditional discards. |
| 5 |
| 6 NOTE: This is a candidate for the 7.9 branch. |
| 7 |
| 8 Signed-off-by: Marek Olšák <maraeo@gmail.com> |
| 9 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> |
| 10 --- |
| 11 diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp |
| 12 index 8f75c82..5dd602f 100644 |
| 13 --- a/src/mesa/program/ir_to_mesa.cpp |
| 14 +++ b/src/mesa/program/ir_to_mesa.cpp |
| 15 @@ -2166,9 +2166,14 @@ ir_to_mesa_visitor::visit(ir_discard *ir) |
| 16 { |
| 17 struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog; |
| 18 |
| 19 - assert(ir->condition == NULL); /* FINISHME */ |
| 20 + if (ir->condition) { |
| 21 + ir->condition->accept(this); |
| 22 + this->result.negate = ~this->result.negate; |
| 23 + ir_to_mesa_emit_op1(ir, OPCODE_KIL, ir_to_mesa_undef_dst, this->result); |
| 24 + } else { |
| 25 + ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV); |
| 26 + } |
| 27 |
| 28 - ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV); |
| 29 fp->UsesKill = GL_TRUE; |
| 30 } |
| 31 |
| 32 -- |
| 33 cgit v0.8.3-6-g21f6 |
OLD | NEW |