intel/reg,fs: Handle immediates properly in subscript()
Just returning the original type isn't what we want in basically any case. Mask and shift the immediate as needed. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7329>
This commit is contained in:

committed by
Marge Bot

parent
e797daba53
commit
69a3559efd
@@ -303,8 +303,12 @@ subscript(fs_reg reg, brw_reg_type type, unsigned i)
|
||||
reg.vstride += (reg.vstride ? delta : 0);
|
||||
|
||||
} else if (reg.file == IMM) {
|
||||
assert(reg.type == type);
|
||||
|
||||
unsigned bit_size = type_sz(type) * 8;
|
||||
reg.u64 >>= i * bit_size;
|
||||
reg.u64 &= BITFIELD64_MASK(bit_size);
|
||||
if (bit_size <= 16)
|
||||
reg.u64 |= reg.u64 << 16;
|
||||
return retype(reg, type);
|
||||
} else {
|
||||
reg.stride *= type_sz(reg.type) / type_sz(type);
|
||||
}
|
||||
|
Reference in New Issue
Block a user