OSDN Git Service

i965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 28 Aug 2013 18:16:27 +0000 (11:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 30 Aug 2013 22:49:31 +0000 (15:49 -0700)
commit4e3d1712a223f9f0b4ff4a34b9b5447a92877347
tree894e1c47f718b86b0888a666760e959d88baff9a
parent217d2f73596f9abfbbdcbf5cfd2b684851178c46
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
src/mesa/drivers/dri/i965/brw_vec4.cpp