diff options
author | Dave Airlie <[email protected]> | 2017-11-29 13:13:17 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-11-29 13:18:44 +1000 |
commit | f8a54c489d305010eb6c622bb4e4acd714ee7532 (patch) | |
tree | 65a06f4c4fee5864e255abb9f756163042e2fe7e /src/gallium/drivers | |
parent | 76837e29e3cb325eecd88bb0b8f9df9d70caf7de (diff) |
r600: lds load cleanups.
This is just some cleanups on top of the last patch from my compute branch.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 14 |
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 2f2e002115a..78f4e33e05b 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1747,12 +1747,13 @@ static int do_lds_fetch_values(struct r600_shader_ctx *ctx, unsigned temp_reg, unsigned dst_reg, unsigned mask) { struct r600_bytecode_alu alu; - int r, i; + int r, i, lasti; if ((ctx->bc->cf_last->ndw>>1) >= 0x60) ctx->bc->force_add_cf = 1; - for (i = 1; i < 4; i++) { + lasti = tgsi_last_instruction(mask); + for (i = 1; i <= lasti; i++) { if (!(mask & (1 << i))) continue; @@ -1763,8 +1764,8 @@ static int do_lds_fetch_values(struct r600_shader_ctx *ctx, unsigned temp_reg, if (r) return r; } - for (i = 0; i < 4; i++) { - if (! (mask & (1 << i))) + for (i = 0; i <= lasti; i++) { + if (!(mask & (1 << i))) continue; /* emit an LDS_READ_RET */ @@ -1781,9 +1782,10 @@ static int do_lds_fetch_values(struct r600_shader_ctx *ctx, unsigned temp_reg, if (r) return r; } - for (i = 0; i < 4; i++) { - if (! (mask & (1 << i))) + for (i = 0; i <= lasti; i++) { + if (!(mask & (1 << i))) continue; + /* then read from LDS_OQ_A_POP */ memset(&alu, 0, sizeof(alu)); |