From 45c3ece266857c2f0d5cef50e95507ffb30694ba Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 27 Aug 2014 19:44:02 -0700 Subject: [PATCH] i965/compaction: Rework 3-src compaction logic. It may be possible to create a contrived example in which a 3-src instruction would have been compacted on Gen < 8. I'd rather not discover it in the wild. Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_eu_compact.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c index 4f509dde135..8c30809f1d5 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_compact.c +++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c @@ -749,11 +749,15 @@ brw_try_compact_instruction(struct brw_context *brw, brw_compact_inst *dst, return false; } - if (brw->gen >= 8 && is_3src(brw_inst_opcode(brw, src))) { - memset(&temp, 0, sizeof(temp)); - if (brw_try_compact_3src_instruction(brw, &temp, src)) { - *dst = temp; - return true; + if (is_3src(brw_inst_opcode(brw, src))) { + if (brw->gen >= 8) { + memset(&temp, 0, sizeof(temp)); + if (brw_try_compact_3src_instruction(brw, &temp, src)) { + *dst = temp; + return true; + } else { + return false; + } } else { return false; } -- 2.30.2