OSDN Git Service

i965: Set fs_inst::base_mrf = -1 by default.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 23 Jun 2016 00:01:12 +0000 (17:01 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 7 Jul 2016 15:12:30 +0000 (16:12 +0100)
commita6a246e17c8a719ea8a9cd9578659c157fb6759e
treeb8487ba2f955c4d671f6a81872479e641185b650
parenta51a9d7ba3c955cf62265260bbffa1e80fd37d37
i965: Set fs_inst::base_mrf = -1 by default.

On MRF platforms, we need to set base_mrf to the first MRF value we'd
like to use for the message.  On send-from-GRF platforms, we set it to
-1 to indicate that the operation doesn't use MRFs.

As MRF platforms are becoming increasingly a thing of the past, we've
forgotten to bother with this.  It makes more sense to set it to -1 by
default, so we don't have to think about it for new code.

I searched the code for every instance of 'mlen =' in brw_fs*cpp, and
it appears that all MRF-based messages correctly program a base_mrf.

Forgetting to set base_mrf = -1 can confuse the register allocator,
causing it to think we have a large fake-MRF region.  This ends up
moving the send-with-EOT registers earlier, sometimes even out of
the g112-g127 range, which is illegal.  For example, this fixes
illegal sends in Piglit's arb_gpu_shader_fp64-layout-std430-fp64-shader,
which had SSBO messages with mlen > 0 but base_mrf == 0.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 3e04e3758e90b2a65eaefb95155d43605f506961)
src/mesa/drivers/dri/i965/brw_fs.cpp