diff options
author | Christoph Bumiller <[email protected]> | 2014-05-17 01:20:17 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-06-02 12:49:03 +0200 |
commit | 476aaf8b8ee77d84c295e1429035e92ecf3a7349 (patch) | |
tree | fbd90b301588ab980f0f14798e9cd314ab1ee899 /src/gallium/drivers/r600/r600_shader.c | |
parent | 6544a4a3425ffab6004918ee1299d4e63ed71755 (diff) |
r600g: HW bug workaround for TGSI_OPCODE_BREAKC
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 5823ba2e857..a4ed796b768 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -6280,10 +6280,26 @@ static int tgsi_loop_breakc(struct r600_shader_ctx *ctx) return -EINVAL; } - r = emit_logic_pred(ctx, ALU_OP2_PRED_SETE_INT, CF_OP_ALU_BREAK); - if (r) - return r; - fc_set_mid(ctx, fscp); + if (ctx->bc->chip_class == EVERGREEN && + ctx->bc->family != CHIP_CYPRESS && + ctx->bc->family != CHIP_JUNIPER) { + /* HW bug: ALU_BREAK does not save the active mask correctly */ + r = tgsi_uif(ctx); + if (r) + return r; + + r = r600_bytecode_add_cfinst(ctx->bc, CF_OP_LOOP_BREAK); + if (r) + return r; + fc_set_mid(ctx, fscp); + + return tgsi_endif(ctx); + } else { + r = emit_logic_pred(ctx, ALU_OP2_PRED_SETE_INT, CF_OP_ALU_BREAK); + if (r) + return r; + fc_set_mid(ctx, fscp); + } return 0; } |