r600g: actualy fix the literal emission
authorJerome Glisse <jglisse@redhat.com>
Wed, 28 Jul 2010 13:11:14 +0000 (09:11 -0400)
committerJerome Glisse <jglisse@redhat.com>
Wed, 28 Jul 2010 13:11:14 +0000 (09:11 -0400)
Previous patch added literal emission to wrong place, we
want to emit literal before emitting a new alu group.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index 9796112775d0ba9d99ab15fddc45186d0672e197..a2d641dced19b6a1af509c3c00b7f946b73e9810 100644 (file)
@@ -557,9 +557,6 @@ static int tgsi_slt(struct r600_shader_ctx *ctx)
        struct r600_bc_alu alu;
        int i, r;
 
-       r = r600_bc_add_literal(ctx->bc, ctx->value);
-       if (r)
-               return r;
        for (i = 0; i < 4; i++) {
                memset(&alu, 0, sizeof(struct r600_bc_alu));
                if (!(inst->Dst[0].Register.WriteMask & (1 << i))) {
@@ -739,6 +736,9 @@ static int tgsi_helper_copy(struct r600_shader_ctx *ctx, struct tgsi_full_instru
        struct r600_bc_alu alu;
        int i, r;
 
+       r = r600_bc_add_literal(ctx->bc, ctx->value);
+       if (r)
+               return r;
        for (i = 0; i < 4; i++) {
                memset(&alu, 0, sizeof(struct r600_bc_alu));
                if (!(inst->Dst[0].Register.WriteMask & (1 << i))) {