From e77b1e777d585254db62e872a74e23351bb36f85 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sun, 29 Aug 2010 11:19:22 +0200 Subject: r600g: added literals where needed for POW instruction Fixes size calculation for the bytecode buffer. Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/r600_shader.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gallium/drivers/r600/r600_shader.c') diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index ebcf19c12b..bf5f28fd9c 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1069,6 +1069,9 @@ static int tgsi_pow(struct r600_shader_ctx *ctx) alu.dst.write = 1; 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; /* b * LOG2(a) */ @@ -1083,6 +1086,9 @@ static int tgsi_pow(struct r600_shader_ctx *ctx) alu.dst.write = 1; 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; /* POW(a,b) = EXP2(b * LOG2(a))*/ @@ -1093,6 +1099,9 @@ static int tgsi_pow(struct r600_shader_ctx *ctx) alu.dst.write = 1; 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 tgsi_helper_tempx_replicate(ctx); -- cgit v1.2.3