summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-08-28 11:16:27 -0700
committerIan Romanick <ian.d.romanick@intel.com>2013-09-10 14:36:04 -0500
commit9dd4e1ef85edfc7a992a19b8678e9d6f8d7a6734 (patch)
tree84680ba65d7af1b1a1ba789d64070772b5fe080b
parentfbbe25ef26b4d9cc39fe0b898b7d2824b7159ec8 (diff)
downloadmesa-9dd4e1ef85edfc7a992a19b8678e9d6f8d7a6734.tar.gz
mesa-9dd4e1ef85edfc7a992a19b8678e9d6f8d7a6734.tar.bz2
mesa-9dd4e1ef85edfc7a992a19b8678e9d6f8d7a6734.zip
i965/vs: 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. VS_OPCODE_PULL_CONSTANT_LOAD_GEN7 uses an IMM as src[0], and stores the GRF as src[1]. 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. Fixes assertion failures in Unigine Sanctuary since we started making register allocation rely on split_virtual_grfs working. (The register classes were actually sufficient, we were just interpreting an IMM as a virtual GRF number.) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68637 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit 4e3d1712a223f9f0b4ff4a34b9b5447a92877347)
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 535eca48e7d..471499fe41c 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1030,10 +1030,14 @@ vec4_visitor::split_virtual_grfs()
vec4_instruction *inst = (vec4_instruction *)node;
/* If there's a SEND message loading from a GRF on gen7+, it needs to be
- * contiguous. Assume that the GRF for the SEND is always in src[0].
+ * contiguous.
*/
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;
+ }
+ }
}
}