Module: Mesa
Branch: master
Commit: 094d66f45992830929d620782c70836b4b9b4a37
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=094d66f45992830929d620782c70836b4b9b4a37

Author: Jerome Glisse <[email protected]>
Date:   Fri Jul 30 13:58:46 2010 -0400

r600g: add KIL opcode support

Signed-off-by: Jerome Glisse <[email protected]>

---

 src/gallium/drivers/r600/r600_shader.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index dd0e039..8159cef 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -556,6 +556,30 @@ static int tgsi_op2(struct r600_shader_ctx *ctx)
        return 0;
 }
 
+static int tgsi_kill(struct r600_shader_ctx *ctx)
+{
+       struct tgsi_full_instruction *inst = 
&ctx->parse.FullToken.FullInstruction;
+       struct r600_bc_alu alu;
+       int i, r;
+
+       for (i = 0; i < 4; i++) {
+               memset(&alu, 0, sizeof(struct r600_bc_alu));
+               alu.inst = ctx->inst_info->r600_opcode;
+               alu.dst.chan = i;
+               alu.src[0].sel = 248;
+               r = tgsi_src(ctx, &inst->Src[0], i, &alu.src[1]);
+               if (r)
+                       return r;
+               if (i == 3) {
+                       alu.last = 1;
+               }
+               r = r600_bc_add_alu(ctx->bc, &alu);
+               if (r)
+                       return r;
+       }
+       return 0;
+}
+
 static int tgsi_slt(struct r600_shader_ctx *ctx)
 {
        struct tgsi_full_instruction *inst = 
&ctx->parse.FullToken.FullInstruction;
@@ -1139,7 +1163,7 @@ static struct r600_shader_tgsi_instruction 
r600_shader_tgsi_instruction[] = {
        {TGSI_OPCODE_CALLNZ,    0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, 
tgsi_unsupported},
        {TGSI_OPCODE_IFC,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, 
tgsi_unsupported},
        {TGSI_OPCODE_BREAKC,    0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, 
tgsi_unsupported},
-       {TGSI_OPCODE_KIL,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, 
tgsi_unsupported},  /* conditional kill */
+       {TGSI_OPCODE_KIL,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT, 
tgsi_kill},  /* conditional kill */
        {TGSI_OPCODE_END,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, 
tgsi_end},  /* aka HALT */
        /* gap */
        {118,                   0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, 
tgsi_unsupported},

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to