summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-11-25 03:13:36 -0800
committerKenneth Graunke <kenneth@whitecape.org>2010-12-01 11:52:36 -0800
commitead2ea89f42b40edc56ddf8c6ce1df4efdcefe2a (patch)
tree6a769d307d873b0026c9f35051a5451e2da5b7d0 /src
parent2ca9256911d8d5aed0de2b3d53d8ef998b105176 (diff)
ir_to_mesa: Add support for conditional discards.
NOTE: This is a candidate for the 7.9 branch. Signed-off-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 8f75c82c3e..5dd602fd83 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2166,9 +2166,14 @@ ir_to_mesa_visitor::visit(ir_discard *ir)
{
struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
- assert(ir->condition == NULL); /* FINISHME */
+ if (ir->condition) {
+ ir->condition->accept(this);
+ this->result.negate = ~this->result.negate;
+ ir_to_mesa_emit_op1(ir, OPCODE_KIL, ir_to_mesa_undef_dst, this->result);
+ } else {
+ ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV);
+ }
- ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV);
fp->UsesKill = GL_TRUE;
}