Mesa (master): r600g: make LIT work properly

Dave Airlie airlied at kemper.freedesktop.org
Tue Aug 31 02:59:30 UTC 2010


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Aug 31 11:57:04 2010 +1000

r600g: make LIT work properly

this is a bit of a workaround, something is wrong with the literal emits here
so we just use the trig copy function to copy the immd to a temp at start of op.

fix VP/FP LIT tests

---

 src/gallium/drivers/r600/r600_shader.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index ed953d3..bac96e8 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1028,6 +1028,9 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
 	r = tgsi_split_constant(ctx, r600_src);
 	if (r)
 		return r;
+	r = tgsi_split_literal_constant(ctx, r600_src);
+	if (r)
+		return r;
 
 	/* dst.x, <- 1.0  */
 	memset(&alu, 0, sizeof(struct r600_bc_alu));
@@ -1056,14 +1059,6 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
 	if (r)
 		return r;
 
-	/* dst.z = NOP - fill Z slot */
-	memset(&alu, 0, sizeof(struct r600_bc_alu));
-	alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP;
-	alu.dst.chan = 2;
-	r = r600_bc_add_alu(ctx->bc, &alu);
-	if (r)
-		return r;
-
 	/* dst.w, <- 1.0  */
 	memset(&alu, 0, sizeof(struct r600_bc_alu));
 	alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV;




More information about the mesa-commit mailing list