From a35b32025011eeac01f2e5a476dbf3ac132a61b3 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 28 Aug 2013 11:22:01 -0700 Subject: [PATCH] i965/fs: Detect GRF sources in split_virtual_grfs send-from-GRF code. It is incorrect to assume that src[0] of a SEND-from-GRF opcode is the GRF. For example, FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD uses src[1] for the GRF. To be safe, loop over all the source registers and mark any GRFs. We probably won't ever have more than one, but it's simpler to just check all three rather than attempting to bail early. Not observed to fix anything yet, but likely to. Parallels the bug fix in the previous commit, which actually does fix known failures. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt Cc: mesa-stable@lists.freedesktop.org --- src/mesa/drivers/dri/i965/brw_fs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b770c0e9e19..96cb2ee5a60 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1359,7 +1359,11 @@ fs_visitor::split_virtual_grfs() * the send is reading the whole thing. */ if (inst->is_send_from_grf()) { - split_grf[inst->src[0].reg] = false; + for (int i = 0; i < 3; i++) { + if (inst->src[i].file == GRF) { + split_grf[inst->src[i].reg] = false; + } + } } } -- 2.30.2