Mesa (master): r600g: added literals where needed for POW instruction
Dave Airlie
airlied at kemper.freedesktop.org
Sun Aug 29 23:41:23 UTC 2010
Module: Mesa
Branch: master
Commit: e77b1e777d585254db62e872a74e23351bb36f85
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e77b1e777d585254db62e872a74e23351bb36f85
Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date: Sun Aug 29 11:19:22 2010 +0200
r600g: added literals where needed for POW instruction
Fixes size calculation for the bytecode buffer.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/gallium/drivers/r600/r600_shader.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index ebcf19c..bf5f28f 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -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);
}
More information about the mesa-commit
mailing list