i965/fs: Fix fs_inst::regs_read() for sources in the ATTR file.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 5 Aug 2015 13:29:30 +0000 (16:29 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Thu, 6 Aug 2015 11:12:12 +0000 (14:12 +0300)
Otherwise it would crash on Gen8 with scalar VS.  The issue can easily
be reproduced with the following patch, but I don't see any reason why
it wouldn't be possible to end up with an ATTR argument here even
without it.

CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Connor Abbott <connor.w.abbott@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 284528d1f84d06f694ae59987e203ed830dfc9b1..1d3bdb4228446a564e7d7593385076320b95e0a8 100644 (file)
@@ -808,6 +808,7 @@ fs_inst::regs_read(int arg) const
    case IMM:
       return 1;
    case GRF:
+   case ATTR:
    case HW_REG:
       return DIV_ROUND_UP(components_read(arg) *
                           src[arg].component_size(exec_size),