summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-01-10 02:56:15 +0000
committerDave Airlie <[email protected]>2018-01-18 03:34:43 +0000
commit7efcafce7c6dd3dc9e71c7d35d6f7ebfd88f106b (patch)
tree4971a44a00c609e4c4acb7f5eadc0c43ab21bd13
parent2bd01adf146b3a16179a5b1305444305ce26ed2e (diff)
r600/shader: only emit add instruction if param has a value.
Just saves a pointless a = a + 0; Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--src/gallium/drivers/r600/r600_shader.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 623e6f7f704..cfc3400f925 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -2864,12 +2864,14 @@ static int r600_tess_factor_read(struct r600_shader_ctx *ctx,
if (r)
return r;
- r = single_alu_op2(ctx, ALU_OP2_ADD_INT,
- temp_reg, 0,
- temp_reg, 0,
- V_SQ_ALU_SRC_LITERAL, param * 16);
- if (r)
- return r;
+ if (param) {
+ r = single_alu_op2(ctx, ALU_OP2_ADD_INT,
+ temp_reg, 0,
+ temp_reg, 0,
+ V_SQ_ALU_SRC_LITERAL, param * 16);
+ if (r)
+ return r;
+ }
do_lds_fetch_values(ctx, temp_reg, dreg, ((1u << nc) - 1));
return 0;