OSDN Git Service

i965/fs: Factor out universally broken calculation of the register component size.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 14 Jul 2015 12:43:44 +0000 (15:43 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Thu, 16 Jul 2015 15:31:01 +0000 (18:31 +0300)
commit4bddd82bf3dae44c2b75cef34e9e85e15d63df7f
treec52da53209e29cd5edc5e66657852f2439d26128
parentb00cd6e4a0f9a84d514f428428be348900236e2e
i965/fs: Factor out universally broken calculation of the register component size.

This in principle simple calculation was being open-coded in a number
of places (in a series I haven't yet sent for review there will be a
couple more), all of them were subtly broken in one way or another:
None of them were handling the HW_REG case correctly as pointed out by
Connor, and fs_inst::regs_read() was handling the stride=0 case rather
naively.  This patch solves both problems and factors out the
calculation as a new fs_reg method.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_ir_fs.h