Mesa (master): i965/eu: Port Broadwell CMP destination type hack to brw_eu_emit.c.
Kenneth Graunke
kwg at kemper.freedesktop.org
Mon Aug 11 02:31:16 UTC 2014
Module: Mesa
Branch: master
Commit: 0d6adce469b36190224cd13173441e98870c695a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d6adce469b36190224cd13173441e98870c695a
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Mon Jun 30 07:51:51 2014 -0700
i965/eu: Port Broadwell CMP destination type hack to brw_eu_emit.c.
See gen8_generator::CMP().
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
src/mesa/drivers/dri/i965/brw_eu_emit.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 822c73c..1128bad 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -1742,6 +1742,14 @@ void brw_CMP(struct brw_compile *p,
struct brw_context *brw = p->brw;
brw_inst *insn = next_insn(p, BRW_OPCODE_CMP);
+ if (brw->gen >= 8) {
+ /* The CMP instruction appears to behave erratically for floating point
+ * sources unless the destination type is also float. Overriding it to
+ * match src0 makes it work in all cases.
+ */
+ dest.type = src0.type;
+ }
+
brw_inst_set_cond_modifier(brw, insn, conditional);
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src0);
More information about the mesa-commit
mailing list