i965/fs: fix assign_constant_locations() for doubles

Uniform doubles will read two registers, in which case we need to mark
both as being live.

v2 (Sam):
  - Use a formula to get the number of registers read with proper
    units (Curro).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Connor Abbott 2015-07-28 17:06:12 -07:00 committed by Samuel Iglesias Gonsálvez
parent cc64c9e441
commit 4f3888c1ca

View file

@ -2056,8 +2056,12 @@ fs_visitor::assign_constant_locations()
}
is_live[last] = true;
} else {
if (constant_nr >= 0 && constant_nr < (int) uniforms)
is_live[constant_nr] = true;
if (constant_nr >= 0 && constant_nr < (int) uniforms) {
int regs_read = inst->components_read(i) *
type_sz(inst->src[i].type) / 4;
for (int j = 0; j < regs_read; j++)
is_live[constant_nr + j] = true;
}
}
}
}