summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTilman Sauerbeck <[email protected]>2010-09-20 21:27:59 +0200
committerTilman Sauerbeck <[email protected]>2010-09-20 21:27:59 +0200
commitef419599d9b18de2a9077c5f0a7f02bfc11d1762 (patch)
tree830cad8761551bb8989dd610af3647252bcbcba0
parent57bf96b43be2abcbadc387d7b5466b772125a093 (diff)
r600g: Implemented the Z and W component write for the SCS opcode.
Signed-off-by: Tilman Sauerbeck <[email protected]>
-rw-r--r--src/gallium/drivers/r600/r600_shader.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 523b6d24515..1702475fa35 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -967,6 +967,55 @@ static int tgsi_scs(struct r600_shader_ctx *ctx)
return r;
}
+ /* dst.z = 0.0; */
+ if (inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_Z) {
+ fprintf(stderr, "writing z\n");
+ memset(&alu, 0, sizeof(struct r600_bc_alu));
+
+ alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
+
+ r = tgsi_dst(ctx, &inst->Dst[0], 2, &alu.dst);
+ if (r)
+ return r;
+
+ alu.src[0].sel = V_SQ_ALU_SRC_0;
+ alu.src[0].chan = 0;
+
+ alu.last = 1;
+
+ r = r600_bc_add_alu(ctx->bc, &alu);
+ if (r)
+ return r;
+
+ r = r600_bc_add_literal(ctx->bc, ctx->value);
+ if (r)
+ return r;
+ }
+
+ /* dst.w = 1.0; */
+ if (inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_W) {
+ memset(&alu, 0, sizeof(struct r600_bc_alu));
+
+ alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
+
+ r = tgsi_dst(ctx, &inst->Dst[0], 3, &alu.dst);
+ if (r)
+ return r;
+
+ alu.src[0].sel = V_SQ_ALU_SRC_1;
+ alu.src[0].chan = 0;
+
+ alu.last = 1;
+
+ r = r600_bc_add_alu(ctx->bc, &alu);
+ if (r)
+ return r;
+
+ r = r600_bc_add_literal(ctx->bc, ctx->value);
+ if (r)
+ return r;
+ }
+
return 0;
}