Mesa (glsl2): ir_to_mesa: Add support for discard instructions.

Eric Anholt anholt at kemper.freedesktop.org
Wed Jun 30 17:34:32 PDT 2010


Module: Mesa
Branch: glsl2
Commit: 5e4dd061d17563828bcce5525400a0ce363aa15d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e4dd061d17563828bcce5525400a0ce363aa15d

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jun 30 17:31:06 2010 -0700

ir_to_mesa: Add support for discard instructions.

Fixes glsl-fs-discard-01.

---

 src/mesa/shader/ir_to_mesa.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index b140d96..b270e2d 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -1342,9 +1342,10 @@ ir_to_mesa_visitor::visit(ir_return *ir)
 void
 ir_to_mesa_visitor::visit(ir_discard *ir)
 {
-   assert(0);
+   assert(ir->condition == NULL); /* FINISHME */
 
-   ir->condition->accept(this);
+   ir_to_mesa_emit_op1(ir, OPCODE_KIL_NV,
+		       ir_to_mesa_undef_dst, ir_to_mesa_undef);
 }
 
 void



More information about the mesa-commit mailing list