Mesa (7.9): ir_to_mesa: Add support for conditional discards.
Ian Romanick
idr at kemper.freedesktop.org
Thu Dec 16 23:08:34 UTC 2010
Module: Mesa
Branch: 7.9
Commit: 0b4287a687c9137384bce6e13388eeb1ee50e784
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b4287a687c9137384bce6e13388eeb1ee50e784
Author: Marek Olšák <maraeo at gmail.com>
Date: Thu Nov 25 03:13:36 2010 -0800
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 at gmail.com>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit ead2ea89f42b40edc56ddf8c6ce1df4efdcefe2a)
---
src/mesa/program/ir_to_mesa.cpp | 9 +++++++--
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 12767c9..80cc8c7 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2137,9 +2137,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;
}
More information about the mesa-commit
mailing list