set fp->UsesKill when emitting OPCODE_KIL
authorBrian <brian.paul@tungstengraphics.com>
Tue, 27 Nov 2007 17:16:51 +0000 (10:16 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 27 Nov 2007 17:31:55 +0000 (10:31 -0700)
src/mesa/shader/slang/slang_emit.c

index f180fb949ab5a3d11b23a83b6d6907930a67ac17..9947544a0856c3ef30c0d44510f6e6e965405e60 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0.3
  *
  * Copyright (C) 2005-2007  Brian Paul   All Rights Reserved.
  *
@@ -859,12 +859,18 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n)
 static struct prog_instruction *
 emit_kill(slang_emit_info *emitInfo)
 {
+   struct gl_fragment_program *fp;
    struct prog_instruction *inst;
    /* NV-KILL - discard fragment depending on condition code.
     * Note that ARB-KILL depends on sign of vector operand.
     */
    inst = new_instruction(emitInfo, OPCODE_KIL_NV);
-   inst->DstReg.CondMask = COND_TR;  /* always kill */
+   inst->DstReg.CondMask = COND_TR;  /* always branch */
+
+   assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB);
+   fp = (struct gl_fragment_program *) emitInfo->prog;
+   fp->UsesKill = GL_TRUE;
+
    return inst;
 }