r600g: added literals where needed for POW instruction
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 29 Aug 2010 09:19:22 +0000 (11:19 +0200)
committerDave Airlie <airlied@redhat.com>
Sun, 29 Aug 2010 23:41:02 +0000 (09:41 +1000)
Fixes size calculation for the bytecode buffer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index ebcf19c..bf5f28f 100644 (file)
@@ -1071,6 +1071,9 @@ static int tgsi_pow(struct r600_shader_ctx *ctx)
        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;
        /* b * LOG2(a) */
        memset(&alu, 0, sizeof(struct r600_bc_alu));
        alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL_IEEE;
@@ -1085,6 +1088,9 @@ static int tgsi_pow(struct r600_shader_ctx *ctx)
        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;
        /* POW(a,b) = EXP2(b * LOG2(a))*/
        memset(&alu, 0, sizeof(struct r600_bc_alu));
        alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE;
@@ -1095,6 +1101,9 @@ static int tgsi_pow(struct r600_shader_ctx *ctx)
        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 tgsi_helper_tempx_replicate(ctx);
 }