mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
i965/fs: Make half(fs_reg, unsigned) handle register files more explicitly
Previously, we had a special case for uniforms and immediates and then a bunch of asserts for various other pessimal things. This commit changes it so that it explicitly does something on each register file. Some of them are disallowed and others are treated properly. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
88414de45e
commit
cf4607e853
1 changed files with 16 additions and 5 deletions
|
|
@ -183,13 +183,24 @@ half(fs_reg reg, unsigned idx)
|
|||
{
|
||||
assert(idx < 2);
|
||||
|
||||
if (reg.file == UNIFORM || reg.file == IMM)
|
||||
switch (reg.file) {
|
||||
case BAD_FILE:
|
||||
case UNIFORM:
|
||||
case IMM:
|
||||
return reg;
|
||||
|
||||
assert(idx == 0 || reg.file != HW_REG);
|
||||
assert(reg.width == 16);
|
||||
reg.width = 8;
|
||||
return horiz_offset(reg, 8 * idx);
|
||||
case GRF:
|
||||
case MRF:
|
||||
assert(reg.width == 16);
|
||||
reg.width = 8;
|
||||
return horiz_offset(reg, 8 * idx);
|
||||
|
||||
case ATTR:
|
||||
case HW_REG:
|
||||
default:
|
||||
unreachable("Cannot take half of this register type");
|
||||
}
|
||||
return reg;
|
||||
}
|
||||
|
||||
static const fs_reg reg_undef;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue