Index: media-libs/mesa/files/7.9-conditional-discards.patch |
diff --git a/media-libs/mesa/files/7.9-conditional-discards.patch b/media-libs/mesa/files/7.9-conditional-discards.patch |
new file mode 100644 |
index 0000000000000000000000000000000000000000..544b05e338aacf642f532bd483a3eced29d949a2 |
--- /dev/null |
+++ b/media-libs/mesa/files/7.9-conditional-discards.patch |
@@ -0,0 +1,33 @@ |
+From ead2ea89f42b40edc56ddf8c6ce1df4efdcefe2a Mon Sep 17 00:00:00 2001 |
+From: Marek Olšák <maraeo@gmail.com> |
+Date: Thu, 25 Nov 2010 11:13:36 +0000 |
+Subject: 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> |
+--- |
+diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp |
+index 8f75c82..5dd602f 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; |
+ } |
+ |
+-- |
+cgit v0.8.3-6-g21f6 |